Image classification method based on online width learning, medium and equipment
Through the online width learning framework and recursive ridge regression algorithm, the problem of high computational complexity in online machine learning is solved, and efficient and accurate image classification is achieved.
Patent Information
- Application Number
- CN202510624611.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-15
- Publication Date
- 2025-07-25
AI Technical Summary
Existing online machine learning algorithms have high computational complexity and insufficient performance when facing new training samples, making it difficult to meet the requirements of efficient online updates, especially in image classification tasks.
Using a completely online width learning framework, by introducing the intermediate variable P(k) and the recursive ridge regression algorithm, the inverse operation during online update is simplified to the reciprocal operation of real numbers and update the output layer weight W(k).
It significantly improves the accuracy of image classification and the online update efficiency of models, reduces the computational complexity, and realizes flexible online learning without the initialization stage.
Smart Images

Figure CN120375092A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer image processing, and more specifically, to an image classification method, medium, and device based on online width learning. Background Art
[0002] Ridge regression is a typical classification algorithm with elegant theoretical guarantees and excellent generalization. However, it has become increasingly rare in real-world scenarios due to data explosion in recent years. To efficiently process high-dimensional non-linear data, Chen Junlong et al. proposed the Broad Learning System (BLS). Thanks to its effectiveness and efficiency, BLS has been successfully applied to various machine learning tasks. However, in practical applications, training data usually exists in the form of data streams and only one training sample can be generated each time. Therefore, once a new training sample arrives, the online learning model must promptly adjust its model parameters in the hope that it can perform better on subsequent arriving samples.
[0003] Fortunately, the data incremental algorithm of BLS can be naturally extended to solve online machine learning tasks. I-BLS is derived from Greville's theory and is the first data incremental algorithm of BLS. However, when learning a new task or category, the performance of I-BLS will drop sharply. To solve the above performance degradation problem, TiBLS and BLS-CIL have been proposed. In addition, Zhong et al. found that when the difference in the scale of the data added each time is large, data increment cannot improve the performance of the model, and proposed the Robust Incremental Broad Learning System (RI-BLS). Whenever a new task arrives, TiBLS stacks a new BLS module on the basis of the current model. Therefore, in the online machine learning scenario, whenever a new training sample arrives, TiBLS has to learn a new BLS module, which will undoubtedly introduce huge computational overhead and does not meet the requirements of online learning efficiency. In contrast, when faced with newly arriving samples, the other three data incremental algorithms only need to adjust the BLS model weights. By setting the number of newly added training samples each time to 1, they can be easily used to solve online machine learning tasks. Although it is simple and effective to use them to solve online machine learning tasks, they are all based on matrix inverse operations. Therefore, they face challenges of insufficient performance and high computational complexity. Summary of the Invention
[0004] In order to overcome the shortcomings and deficiencies in the prior art, the purpose of the present invention is to provide an image classification method, medium and device based on online width learning; the method adopts a completely online width learning framework, and simplifies the inverse operation during online updating to the reciprocal operation of a real number, which greatly improves the accuracy of model image classification and the efficiency of model online updating.
[0005] In order to achieve the above object, the present invention is implemented by the following technical scheme: an image classification method based on online width learning, the image to be classified is input into the online width learning model, the output of the online width learning model is obtained, and then the image classification result is obtained; the online width learning model includes a feature node group, an enhancement node group and an output layer; the online width learning model refers to when a new image training sample arrives, by introducing an intermediate variable P (k) To realize the output layer weight W (k) Model updated online; The output layer weight W (k) The online update method is: k Image training samples x k When reaching the online width learning model, calculate the k Image training samples x k The width characteristic a k ; Using the recursive ridge regression algorithm and the Woodbury matrix identity, the intermediate variable P in the previous iteration (k-1) Update the intermediate variable P based on (k) , and in the last iteration the output layer weight W (k-1) Update the output layer weight W based on (k) .
[0006] Preferably, update the intermediate variable P (k) , using the following formula: ; Wherein, T represents the transpose operation; Update the output layer weight W (k) , using the following formula: ; Among them, y k For the k Image training samples x k The real label.
[0007] Preferably, the output layer weight W (k) The initial value is W (0) =0; intermediate variable P (k) The initial value is P (0) =(λI) -1 ; Where λ is the regularization coefficient; I represents the unit matrix.
[0008] Preferably, calculating the k -th image training sample x k 's width feature a k means: According to the k -th image training sample x k , calculate each feature node group z i and each enhancement node group h j ; Concatenate all the feature node groups z i and the enhancement node groups h j to obtain the k -th image training sample x k 's width feature a k .
[0009] Preferably, for the k -th image training sample , where d represents the feature dimension of the original image; calculating the i-th feature node group is: , i = 1, 2, …, n f ; where and represent randomly generated weight matrices and bias vectors; f i represents the i -th feature node group; p represents the number of feature nodes in each feature node group; n f represents the number of feature node groups; φ () represents the activation function; Combine all the feature node groups into ; Calculate the j -th enhancement node group as: , j = 1, 2, …, n e ; where and respectively represent weights and biases randomly sampled from a given distribution; e j represents the j -th enhancement node group; q represents the number of enhancement nodes in each enhancement node group; n e represents the number of enhancement node groups; σ() represents the non-linear activation function.
[0010] Preferably, calculate the k width feature a of the k th image training sample x k as: .
[0011] Preferably, after calculating the k width feature a of the k th image training sample x k , calculate the k predicted label of the k th image training sample x ; Compare the predicted label with the true label y k to update the online prediction accuracy of the online width learning model.
[0012] Preferably, calculate the k predicted label of the k th image training sample x as: .
[0013] A readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the image classification method based on online width learning.
[0014] A computer device, comprising a processor and a memory for storing a program executable by the processor, and when the processor executes the program stored in the memory, the image classification method based on online width learning is implemented.
[0015] Compared with the prior art, the present invention has the following advantages and beneficial effects: 1. The image classification method based on online width learning proposed by the present invention does not require an initialization training stage and is a concise online machine learning framework; the traditional BLS data increment algorithm usually requires a batch of data for initialization training, and then the BLS model updates the model weights online when facing new data; it limits the applicability and flexibility of the above algorithm; 2. The image classification method based on online width learning proposed by the present invention simplifies the operation of finding the pseudo-inverse of a large matrix in the online update process of the online width learning model to an operation of finding the reciprocal of a real number; it not only reduces the error accumulation caused by multiple matrix inversions, but also greatly improves the online update efficiency of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1It is a flowchart of the update method of the online width learning model of the present invention; Figure 2 It is a schematic diagram of the online width learning model of the present invention. Detailed implementation manners
[0017] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0018] Embodiment 1 In this embodiment, an image classification method based on online width learning is provided. The image to be classified is input into the online width learning model, and the output of the online width learning model is obtained, and then the image classification result is obtained. The online width learning model refers to a model that realizes online update of the output layer weight W by introducing an intermediate variable P when a new image training sample arrives. (k) to achieve the output layer weight W (k) for online update.
[0019] The update method of the online width learning model is as Figure 1 shown: The online width learning model proposed by the present invention includes a feature node group, an enhancement node group, and an output layer, as Figure 2 shown.
[0020] Set the initial value of the output layer weight W (k) to W (0) = 0; the initial value of the intermediate variable P (k) is P (0) = (λI) -1 ; where λ is the regularization coefficient; I represents the identity matrix.
[0021] When the k th image training sample arrives, where d represents the feature dimension of the original image; calculate the i-th feature node group : , i = 1, 2, …, n f ; where and represent randomly generated weight matrices and bias vectors; f i represents the i th feature node group; p represents the number of feature nodes in each feature node group; n f represents the number of feature node groups; φ () represents the activation function; Combine all the feature node groups into ; Calculate the j th enhanced node group as: , j = 1, 2, …, n e ; where, and respectively represent the weight and bias randomly sampled from a given distribution; e j represents the j th enhanced node group; q represents the number of enhanced nodes in each enhanced node group; n e represents the number of enhanced node groups; σ() represents the non - linear activation function; Cascade all the feature node groups z i and the enhanced node groups h j , the width feature a k of the k th image training sample x k is: .
[0022] After obtaining the width feature a k of the k th image training sample x k , calculate the predicted label k of the k th image training sample x as: ; Compare the predicted label with the true label y k to update the online prediction accuracy of the online width learning model.
[0023] Update the intermediate variable P (k) as: ; where, P (k-1) is the intermediate variable of the previous iteration; T represents the transpose operation; Update the output layer weight W (k) as: ; where, W (k-1) is the output layer weight of the previous iteration; y k is the true label of the k th image training sample x k .
[0024] Output layer weight W (k) The update principle is as follows: In the existing model update method, when the first image training sample x1 arrives, the width feature a1 of the first image training sample x1 is extracted, and the predicted label is expressed as: , where W (0) represents the initial output layer weight, which is a zero matrix with an appropriate shape; when the true label y1 of the first image training sample arrives, the output layer weight W (1) is calculated using ridge regression as: (1) where I represents the identity matrix with an appropriate shape; When the second image training sample x2 arrives, the width feature a2 of the second image training sample x2 is extracted, and the predicted label is expressed as: ; when the true label y2 of the second image training sample arrives, the output layer weight W (2) is calculated as: (2) Let the Gram matrix of the sample features be ; then, the recurrence relation of the Gram matrix can be obtained as follows: (3) The right - hand side of formula (2) can be expressed as: (4) Substituting formula (4) into formula (2), similar to recursive ridge regression, the output layer weight W (2) can be expressed as: (5) where ; Without loss of generality, when the k th image training sample x k ( k = 2, 3, …, n ) arrives, the output layer weight W (k) can be expressed as: (6) where ; observing formula (1) and formula (6), when and only when W (0) = 0 and K (0) = λI, we find that the W (1) calculated by these two formulas is equivalent; that is, the first update of the output layer weight can be naturally incorporated into the subsequent online update process; therefore, the present invention becomes a fully online machine learning model (without an initialization phase); Let P (0) =( K (0) ) -1 and W (0) = 0. Using the Woodbury matrix identity, the output layer weight W (k) can be derived as: (7) where (8) Equation (8) converts the inversion operation of the large matrix in Equation (6) into a reciprocal operation of a real number, greatly reducing the computational complexity and improving the model accuracy.
[0025] To verify the performance of the present invention in image classification tasks, in this embodiment, the present invention is compared with I-BLS, CIL-BLS, and RI-BLS on the USPS and MNIST datasets. The MNIST dataset contains 60,000 training samples and 10,000 test samples, and each sample is a 28*28 grayscale image. The online width learning task in this embodiment combines the training set and the test set into a sample set containing 70,000 samples and inputs them into the online width learning model (OBLS) of the present invention in sequence for learning and classification. USPS contains a total of 9,298 samples belonging to 10 categories, and each sample has 256 features. Similar to MNIST, all samples are input into the online width learning model (Online Broad Learning System, OBLS) of the present invention in sequence for learning and classification. The average values and standard deviations of the accuracy and online update time of the present invention and the comparative methods on the USPS and MNIST datasets are shown in Table 1.
[0026] Table 1 Comparison of accuracy and online update time on USPS and MNIST datasets
[0027] From Table 1, we can find that the online width learning model proposed by the present invention achieved accuracies of 93.6±0.39% and 92.5±0.11% respectively in the image classification tasks of USPS and MNIST; they are higher than the accuracies of the comparative methods on the same datasets. In addition, the online update time of the online width learning model proposed by the present invention on the USPS and MNIST datasets is only 0.02±0.01 seconds; they are also much lower than the comparative methods on the same datasets. Therefore, the image classification method based on online width learning proposed by the present invention has the advantages of high accuracy and short update time.
[0028] Embodiment 2 A readable storage medium in this embodiment, wherein the readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to execute the image classification method based on online width learning described in Embodiment 1.
[0029] Embodiment 3 A computer device in this embodiment includes a processor and a memory for storing programs executable by the processor. When the processor executes the programs stored in the memory, the image classification method based on online width learning described in Embodiment 1 is implemented.
[0030] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications made without departing from the spirit and principle of the present invention shall be equivalent replacement methods and are all included in the protection scope of the present invention.
Claims
1. An image classification method based on online width learning, characterized in that: The image to be classified is input into an online width learning model to obtain the output of the online width learning model, and then the image classification result is obtained; the online width learning model includes a feature node group, an enhancement node group, and an output layer; An online width learning model refers to a model that, when new image training samples arrive, realizes the online update of the output layer weight W by introducing an intermediate variable P (k) (k) The output layer weight W (k) The online update method is as follows: when the k th image training sample x k reaches the online width learning model, calculate the k th image training sample x k 's width feature a k ; use the recursive ridge regression algorithm and the Woodbury matrix identity to update the intermediate variable P (k-1) based on the previous iteration's intermediate variable P (k) , and update the output layer weight W (k-1) based on the previous iteration's output layer weight W (k) .
2. The image classification method based on online width learning according to claim 1, characterized in that: Update the intermediate variable P (k) , using the following formula: ; where T represents the transpose operation; Update the weights W of the output layer (k) , using the following formula: ; where y k is the k true label of the k th image training sample x 3. The image classification method based on online width learning according to claim 2, wherein: The weight W of the output layer (k) has an initial value of W (0) = 0; The intermediate variable P (k) has an initial value of P (0) = (λI) -1 ; where λ is the regularization coefficient; I represents the identity matrix.
4. The image classification method based on online width learning according to claim 1, characterized in that: The calculation of the k width feature a of the k th image training sample x k refers to: based on the k th image training sample x k , calculate each feature node group z i and each enhanced node group h j ; concatenate all the feature node groups z i and the enhanced node groups h j to obtain the width feature a of the k th image training sample x k k . 5. The image classification method based on online width learning according to claim 4, wherein: For the k th image training sample , where d represents the feature dimension of the original image; calculate the i-th feature node group as: , i = 1, 2, …, n f ; Among them, and represent a randomly generated weight matrix and bias vector; f i represents the i th feature node group; p represents the number of feature nodes in each feature node group; n f represents the number of feature node groups; φ () represents an activation function; Combine all the feature nodes into ; Calculate the j th enhanced node group as: , j = 1, 2, …, n e ; Among them, and respectively represent the weights and biases randomly sampled from a given distribution; e j represents the j th augmented node group; q represents the number of augmented nodes in each augmented node group; n e represents the number of augmented node groups; σ() represents a non-linear activation function.
6. The image classification method based on online width learning according to claim 5, wherein: Calculate the k width feature a of the k th image training sample x k as follows: 。 7. The image classification method based on online width learning according to claim 1, wherein: After calculating the width feature a k of the k th image training sample x k , calculate the predicted label k of the k th image training sample x ; compare the predicted label with the true label y k and update the online prediction accuracy of the online width learning model.
8. The image classification method based on online width learning according to claim 7, characterized in that: Calculate the k predicted label of the k th image training sample x is as follows: 。 9. A readable storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the image classification method based on online width learning according to any one of claims 1-8.
10. A computer device, comprising a processor and a memory for storing processor-executable programs, characterized in that, When the processor executes the program stored in the memory, it implements the image classification method based on online width learning according to any one of claims 1-8.
Citation Information
Patent Citations
Data flow driven dynamic node width learning image classification method
CN118154945A