Training method of image classification model, image classification method and device
By constructing an image classification model through layer-by-layer cascading and updating the fuzzy rules based on the correlation between TSK fuzzy rules and importance, the overfitting problem of the deep fuzzy classifier is solved, and the accuracy and generalization ability of image classification are improved.
Patent Information
- Application Number
- CN202511120786.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-08-12
AI Technical Summary
Existing deep fuzzy classifiers do not fully consider the association between TSK fuzzy rules during the training and testing stages, resulting in serious overfitting, limited generalization ability, and low image classification accuracy.
An image classification model is constructed by a layer-by-layer cascade method. Based on the correlation between TSK fuzzy rules, the strengthened TSK fuzzy rule consequences are determined, and the importance fuzzy rules are used to update the input of each layer of sub-units to enhance the classification and generalization capabilities of the image classification model.
It improves the accuracy and generalization ability of large-scale image classification and enhances the overall performance of image classification models.
Smart Images

Figure CN120635600B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of image classification, and in particular to a training method of an image classification model, an image classification method and device. BACKGROUND
[0002] To solve the problem of large-scale image classification, Takagi-Sugeno-Kang (TSK) fuzzy classifiers are widely used to construct deep fuzzy classifiers with hierarchical structure to solve the problem of large-scale image classification due to their good interpretability and non-linear expression ability. Deep fuzzy classifiers with hierarchical structure can achieve at least comparable generalization performance to neural networks or even deep neural networks, and can well solve the problem of large-scale image classification.
[0003] However, although some deep fuzzy classifiers with hierarchical structure have appeared in the prior art, they do not consider the association between the TSK fuzzy rules generated in each layer of subunits in the training and testing stages, which makes the fuzzy rules that have a great impact on the overall performance of the deep fuzzy classifier not fully focused on, resulting in limited performance of the existing deep fuzzy classifier, and the image classification effect cannot meet the actual demand. In addition, the existing deep fuzzy classifier usually uses all TSK fuzzy rules in the process of updating the training set and test set of each layer of subunit inputs layer by layer, resulting in that the samples in the training set and test set of each layer of subunit inputs will contain a large amount of redundant features, which makes the existing deep fuzzy classifier prone to overfitting phenomenon, resulting in that the existing deep fuzzy classifier has limited generalization ability, and the image classification precision needs to be improved. Therefore, in order to better solve the problem of large-scale image classification, it is necessary to further improve the performance of the deep fuzzy classifier, especially the generalization ability, to improve the classification precision of large-scale images. SUMMARY
[0004] The present disclosure aims to at least solve one of the problems in the prior art, and provides a training method of an image classification model, an image classification method and device.
[0005] In one aspect of the present disclosure, a training method of an image classification model is provided, which comprises:
[0006] Obtaining an image classification dataset, and randomly dividing the image classification dataset into a training set and a test set according to a proportion, wherein the image classification dataset comprises a plurality of image samples carrying true labels;
[0007] Respectively taking a plurality of TSK fuzzy classifiers as a layer of subunits, and constructing a plurality of layers of subunits into an image classification model by cascading layer by layer;
[0008] During the training phase, for each layer of sub-units: based on the correlation between TSK fuzzy rules, the corresponding enhanced TSK fuzzy rule consequences are determined; based on the enhanced TSK fuzzy rule consequences, the prediction results of each image sample in the input training sample set are determined; based on the prediction results of each image sample in the training sample set and the training error gradient determined by the importance fuzzy rule, the training sample set is updated, and the updated training sample set is used as the training sample set for the next layer of sub-units; wherein, the training sample set for the first layer of sub-units is the training set;
[0009] In the testing phase, for each layer of sub-units: based on the enhanced TSK fuzzy rule consequences determined in the training phase, the prediction results of each image sample in the input test sample set are determined; based on the prediction results of each image sample in the test sample set and the test error gradient determined by the importance fuzzy rule, the test sample set is updated, and the updated test sample set is used as the test sample set input to the next layer of sub-units; wherein, the test sample set input to the first layer of sub-units is the test set.
[0010] Optionally, determining the corresponding enhanced TSK fuzzy rule consequent based on the association relationship between the TSK fuzzy rules includes:
[0011] Using the FCM algorithm, the antecedents of TSK fuzzy rules are generated, where The antecedents of the TSK fuzzy rules include:
[0012] ;
[0013] ;
[0014] in, Indicates the Layer subunit The TSK fuzzy rule corresponds to the The center of the Gaussian membership function, satisfy , represents the total number of TSK fuzzy rules, satisfy , represents the total number of features for each image sample, Indicates input Training sample set of layer subunits and test sample set Subunit dataset The Image samples No. Features, satisfy , represents the total number of image samples included in the image classification dataset, Represents a subunit dataset The Image samples Belong to The membership degree of TSK fuzzy rules, Indicates the Layer subunit The TSK fuzzy rule corresponds to the The kernel width of the Gaussian membership function, represents the scale parameter;
[0015] According to the antecedent of TSK fuzzy rules, the activation degree and corresponding normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the input training sample set are determined, wherein the training sample set Middle Image samples The corresponding The activation degree of TSK fuzzy rules and the corresponding normalized activation Respectively expressed as:
[0016] ;
[0017] ;
[0018] in, Represents the training sample set Middle Image samples No. Features
[0019] According to the normalized activation of each TSK fuzzy rule corresponding to each image sample in the training sample set, the antecedent matrix of the training sample set is determined, where the training sample set The antecedent matrix The Row Elements Expressed as:
[0020] ;
[0021] in, Represents matrix transpose;
[0022] According to the antecedent matrix of the training sample set, the consequent vector of the TSK fuzzy rule is determined using the least squares method, where The consequent vector of the TSK fuzzy rule corresponding to the layer subunit Expressed as:
[0023] ;
[0024] in, Represents the training set The corresponding true label set, is a column vector, and:
[0025] ;
[0026] in, For the The consequent of the first TSK fuzzy rule corresponding to the layer subunit includes the 0th, 1st, ..., elements, Respectively The consequent of the second TSK fuzzy rule corresponding to the layer subunit includes the 0th, 1st, ..., elements, Respectively The layer subunit corresponds to The consequent of each TSK fuzzy rule includes the 0th, 1st, ..., elements;
[0027] The consequent vector of the TSK fuzzy rule is converted into the consequent matrix of the corresponding TSK fuzzy rule, where the first The consequent matrix of the TSK fuzzy rule corresponding to the layer subunit Expressed as:
[0028] ;
[0029] According to the consequent matrix of TSK fuzzy rules, the TSK fuzzy rule association matrix is determined, where the first TSK fuzzy rule association matrix corresponding to the layer sub-unit Expressed as:
[0030] ;
[0031] in, Indicates the The enhanced TSK fuzzy rule consequent matrix corresponding to the layer subunit is: Indicates that and The product of is normalized by row, when hour, ;
[0032] According to the TSK fuzzy rule association matrix, the corresponding enhanced TSK fuzzy rule consequent matrix is determined, where the The consequent matrix of the enhanced TSK fuzzy rule corresponding to the layer subunit Expressed as:
[0033] ;
[0034] The first The consequent matrix of the enhanced TSK fuzzy rule corresponding to the layer subunit Convert it into a column vector by row concatenation as the corresponding enhanced TSK fuzzy rule consequent vector .
[0035] Optionally, determining the prediction result of each image sample in the input training sample set based on the enhanced TSK fuzzy rule consequence includes:
[0036] According to the consequent vector of the enhanced TSK fuzzy rule, the prediction result of each image sample in the input training sample set is determined;
[0037] Among them, The training sample set determined by the layer subunit Middle Image samples The prediction results Expressed as:
[0038] .
[0039] Optionally, updating the training sample set based on the prediction result of each image sample in the training sample set and the training error gradient determined by the importance fuzzy rule includes:
[0040] For the first TSK fuzzy rule association matrix corresponding to the layer sub-unit Calculate the sum of matrix elements by column. The TSK fuzzy rules corresponding to the maximum sum values are determined as Layer subunits corresponding to importance fuzzy rules;
[0041] The importance fuzzy rule is used to determine the training error gradient, where Layer subunits target the training sample set Middle Image samples The training error gradient Expressed as:
[0042] ;
[0043] in, Indicates the Layer subunits target the training sample set Middle Image samples The output error and , Represents the training sample set Middle Image samples The true label, The Elements Expressed as:
[0044] ;
[0045] in, Represents the training sample set Middle Image samples The corresponding The normalized activation of the importance fuzzy rules, Represents the training sample set Middle Image samples The corresponding The calculation results of the importance fuzzy rules and ,in, Respectively represent the The layer subunit corresponds to The consequents of the importance fuzzy rules include the 0th, 1st, 2nd, ..., elements, The training sample sets are Middle Image samples 1st, 2nd, ..., Features, Indicates the Layer subunit The importance fuzzy rule corresponding to The center of the Gaussian membership function, Indicates the Layer subunit The importance fuzzy rule corresponding to The kernel width of the Gaussian membership function, Indicates the Layer subunit The importance fuzzy rule corresponding to The center of the Gaussian membership function, Indicates the Layer subunit The importance fuzzy rule corresponding to The kernel width of the Gaussian membership function, Indicates the The layer subunit corresponds to The consequent of the importance fuzzy rule includes elements;
[0046] The training error gradient matrix is constructed based on the training error gradient, where the first The training error gradient matrix corresponding to the layer sub-unit No. The row element is Layer subunits target the training sample set Middle Image samples The training error gradient ;
[0047] The training error gradient matrix is used to update the input training sample set, where the first The updated training sample set corresponding to the layer sub-unit Expressed as:
[0048] ;
[0049] in, Represents the feature learning rate.
[0050] Optionally, determining a prediction result for each image sample in an input test sample set based on the enhanced TSK fuzzy rule consequence determined in the training phase includes:
[0051] According to the antecedents of the TSK fuzzy rules determined in the training phase, the activation degree and the corresponding normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the input test sample set are determined, wherein the input Test sample set of layer subunits Middle Image samples The corresponding The activation degree of TSK fuzzy rules and the corresponding normalized activation Respectively expressed as:
[0052] ;
[0053] ;
[0054] in, Represents the test sample set Middle Image samples No. Features
[0055] According to the normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the test sample set, the antecedent matrix of the test sample set is determined, where the test sample set The antecedent matrix The Row Elements Expressed as:
[0056] ;
[0057] According to the antecedent matrix of the test sample set and the consequent vector of the enhanced TSK fuzzy rule determined in the training phase, the prediction result of each image sample in the input test sample set is determined, wherein the first Test sample set determined by layer subunit Middle Image samples The prediction results Expressed as:
[0058] .
[0059] Optionally, updating the test sample set based on the prediction result of each image sample in the test sample set and the test error gradient determined by the importance fuzzy rule includes:
[0060] The test error gradient is determined using the importance fuzzy rule, where Layer subunit for the test sample set Middle Image samples The test error gradient Expressed as:
[0061] ;
[0062] in, Indicates the Layer subunit for the test sample set Middle Image samples The output error and , Indicates the Test sample set determined by layer subunit Middle Image samples The prediction results, when hour, is the true label of an image sample randomly selected from the training set;
[0063] The test error gradient matrix is constructed based on the test error gradient, where the first The test error gradient matrix corresponding to the layer sub-unit No. The row element is Layer subunit for the test sample set Middle Image samples The test error gradient ;
[0064] The test error gradient matrix is used to update the input test sample set, where the first Updated test sample set corresponding to the layer subunit Expressed as:
[0065] .
[0066] Optionally, obtaining an image classification dataset includes:
[0067] Obtain multiple training images with real labels;
[0068] Extracting features of each of the training images using a convolutional neural network to obtain corresponding image samples;
[0069] The image samples are combined into the image classification dataset.
[0070] Another aspect of the present disclosure provides an image classification method, the image classification method comprising:
[0071] Acquire a dataset of images to be classified, wherein the dataset includes a plurality of images to be classified;
[0072] The image classification model trained by the training method of the image classification model described above is used to classify the images to be classified in the image data set to be classified.
[0073] Another aspect of the present disclosure provides a training device for an image classification model, the training device for an image classification model comprising:
[0074] An acquisition module is used to acquire an image classification dataset and randomly divide the image classification dataset into a training set and a test set in proportion, wherein the image classification dataset includes a plurality of image samples carrying real labels;
[0075] A construction module, configured to use multiple TSK fuzzy classifiers as a sub-unit, and construct the multiple sub-units into an image classification model by cascading them layer by layer;
[0076] A training module is configured to execute a training phase, for each layer of sub-units: based on the association relationship between TSK fuzzy rules, determine the corresponding enhanced TSK fuzzy rule consequences; based on the enhanced TSK fuzzy rule consequences, determine the prediction result of each image sample in the input training sample set; based on the prediction result of each image sample in the training sample set and the training error gradient determined by the importance fuzzy rule, update the training sample set, and use the updated training sample set as the training sample set input to the next layer of sub-units; wherein the training sample set input to the first layer of sub-units is the training set;
[0077] A testing module is used to execute a testing phase, for each layer of sub-units: based on the enhanced TSK fuzzy rule consequence determined in the training phase, determine the prediction result of each image sample in the input test sample set; based on the prediction result of each image sample in the test sample set and the test error gradient determined by the importance fuzzy rule, update the test sample set, and use the updated test sample set as the test sample set input to the next layer of sub-units; wherein, the test sample set input to the first layer of sub-units is the test set.
[0078] Another aspect of the present disclosure provides an image classification device, comprising:
[0079] An image acquisition module is used to acquire a dataset of images to be classified, wherein the dataset of images to be classified includes a plurality of images to be classified;
[0080] The classification module is used to classify the images to be classified in the image data set to be classified using the image classification model trained by the training method of the image classification model described above or the image classification model trained by the training device of the image classification model described above.
[0081] Another aspect of the present disclosure provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the image classification model training method or image classification method described above.
[0082] Another aspect of the present disclosure provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the image classification model training method or image classification method described above.
[0083] Another aspect of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the image classification model training method or image classification method described above.
[0084] Compared with the prior art, the present invention regards multiple TSK fuzzy classifiers as a layer of sub-units respectively, and constructs the multi-layer sub-units into an image classification model through a layer-by-layer cascade method. The TSK fuzzy rules that have a great influence on the performance of the image classification model are utilized, and the input of each layer of sub-units is updated layer by layer based on the importance fuzzy rules determined based on the correlation relationship between the TSK fuzzy rules. The classification and generalization capabilities of the image classification model for large-scale image data sets are enhanced, so that the image classification model can achieve a higher level of performance when solving the classification problem of large-scale images, thereby improving the classification accuracy of large-scale images. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings, and these exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0086] Figure 1 A flowchart of a method for training an image classification model provided in one embodiment of the present disclosure;
[0087] Figure 2 A flowchart of a method for training an image classification model provided in another embodiment of the present disclosure;
[0088] Figure 3 A schematic diagram of a cascade method of sub-units at each layer during the training phase provided by another embodiment of the present disclosure;
[0089] Figure 4 A schematic diagram of a cascade method of sub-units at each layer during a test phase according to another embodiment of the present disclosure;
[0090] Figure 5 A schematic diagram of various steps performed by a first layer sub-unit during a training phase, provided in accordance with another embodiment of the present disclosure;
[0091] Figure 6 A schematic diagram of some images of 10 image categories included in the CIFAR10 image set provided in another embodiment of the present disclosure. DETAILED DESCRIPTION
[0092] In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. However, it will be understood by those skilled in the art that in each embodiment of the present disclosure, many technical details are provided to enable readers to better understand the present disclosure. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solutions claimed in the present disclosure can be implemented. The division of the following embodiments is for the convenience of description and should not constitute any limitation on the specific implementation of the present disclosure. The various embodiments can be combined and referenced with each other under the premise that there is no contradiction.
[0093] One embodiment of the present disclosure relates to a method for training an image classification model, the process of which is as follows: Figure 1 As shown, it includes steps S110 to S140. Figure 2 , steps S110 to S140 are described in detail.
[0094] Step S110: obtaining an image classification dataset, and randomly dividing the image classification dataset into a training set and a test set in proportion, wherein the image classification dataset includes a plurality of image samples carrying real labels.
[0095] Specifically, the image classification dataset may include large-scale image samples involving multiple image types, so as to solve the classification problem of large-scale images using the image classification model. Step S110 may divide the acquired image classification dataset into a training set and a test set in proportion, so as to train the image classification model using the training set and test the trained image classification model using the test set.
[0096] Exemplarily, in step S110, obtaining an image classification dataset includes: obtaining multiple training images with real labels; using a convolutional neural network to extract features of each training image to obtain corresponding image samples; and combining the image samples into an image classification dataset.
[0097] Specifically, convolutional neural networks can automatically, efficiently, and hierarchically extract image features, have spatial invariance, learnability, and task adaptability, and have high accuracy in image feature extraction and are adaptable to complex categories. Therefore, this embodiment uses convolutional neural networks to extract features of each training image, and constructs an image classification dataset using the corresponding feature maps as image samples.
[0098] For example, the image classification dataset It can be expressed as ,in, represents the matrix transpose, Represents an image classification dataset The total number of image samples included, They are image classification datasets The 1st, 2nd, ..., Nth image samples in each image sample may include features, that is, the dimension of each image sample is The training set can be expressed as , the test set can be expressed as Among them, the training set The number of image samples included can be recorded as , test set The number of image samples included can be recorded as ,and Each image sample carries its corresponding true label, so the training set The corresponding true label set can be recorded as , the true label set is Each true label in the training set is The true label of each image sample in .
[0099] In step S120 , the multiple TSK fuzzy classifiers are respectively used as a layer of sub-units, and the multi-layer sub-units are constructed into an image classification model by cascading layer by layer.
[0100] Specifically, step S120 may also determine the number of layers of subunits included in the image classification model as a deep fuzzy classifier. And the number of TSK fuzzy rules used in each layer of sub-units, and multiple TSK fuzzy classifiers are used as a layer of sub-units respectively, and a deep fuzzy classifier, i.e., an image classification model, is formed by cascading sub-units layer by layer.
[0101] It should be noted that the number of layers of sub-units included in the image classification model is It can be set according to actual needs. As the number of sub-units included in the image classification model increases As the number of layers of sub-units included in the image classification model increases, the classification accuracy of the image classification model will gradually improve. However, experiments show that when the number of layers of sub-units included in the image classification model increases, the classification accuracy of the image classification model will gradually improve. After increasing to a certain extent, the classification accuracy of the image classification model tends to be stable, so the number of layers of sub-units included in the image classification model The minimum number of layers when the classification accuracy of the image classification model tends to be stable is preferred. For example, the number of layers of sub-units included in the image classification model is It can be set to 5 or more, preferably 5.
[0102] Step S130, during the training phase, for each layer of sub-units: based on the correlation between TSK fuzzy rules, determine the corresponding enhanced TSK fuzzy rule consequences; based on the enhanced TSK fuzzy rule consequences, determine the prediction results of each image sample in the input training sample set; based on the prediction results of each image sample in the training sample set and the training error gradient determined by the importance fuzzy rule, update the training sample set, and use the updated training sample set as the training sample set input to the next layer of sub-units; wherein, the training sample set input to the first layer of sub-units is the training set.
[0103] Specifically, let the layer number of the subunit be m, then . Combined with Figure 2 , before the start of the training phase, let m=1. Then, in the training phase, the following steps are performed in sequence: for the deep fuzzy classifier, i.e., the m-th layer sub-unit in the image classification model, based on the association relationship between TSK fuzzy rules, the association matrix between all TSK fuzzy rules is calculated, the association matrix between TSK fuzzy rules is used to strengthen the TSK fuzzy rule consequences, and the classification result of the current sub-unit is output, i.e., the prediction result for the input training sample set, wherein the training sample set of the first layer sub-unit is the training set, and then the association matrix between TSK fuzzy rules is used to determine the prediction result of all TSK fuzzy rules. Fuzzy rules as the current sub-unit Importance fuzzy rules are used to calculate the gradient of the output error of the current sub-unit to the input, i.e., the training error gradient, using the importance fuzzy rules and the prediction results of the input training sample set. The gradient is added to the corresponding input features to update the training sample set. The current sub-unit is cascaded with the next layer of sub-units using the reinforced TSK fuzzy rule consequence of the current sub-unit and the updated input, i.e., the updated training sample set. Then, , at this time, if you are not satisfied , then execute the various steps of the training phase again, otherwise enter the testing phase.
[0104] Exemplarily, in step S130, based on the association relationship between TSK fuzzy rules, the corresponding enhanced TSK fuzzy rule consequent is determined, including the following steps 3-1-1 to 3-1-8.
[0105] Step 3-1-1: Use FCM (Fuzzy C-Means) algorithm to generate the antecedent of TSK fuzzy rules, where The antecedents of the TSK fuzzy rules include:
[0106] ;
[0107] ;
[0108] in, Indicates the Layer subunit The TSK fuzzy rule corresponds to the The center of the Gaussian membership function, satisfy , represents the total number of TSK fuzzy rules, satisfy , represents the total number of features for each image sample, Indicates input Training sample set of layer subunits and test sample set Subunit dataset The Image samples No. Features, satisfy , Represents the total number of image samples included in the image classification dataset, Represents a subunit dataset The Image samples Belong to The membership degree of TSK fuzzy rules, Indicates the Layer subunit The TSK fuzzy rule corresponds to the The kernel width of the Gaussian membership function, represents the scale parameter.
[0109] Step 3-1-2: According to the antecedent of TSK fuzzy rule, determine the activation degree and corresponding normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the input training sample set, where the training sample set Middle Image samples The corresponding The activation degree of TSK fuzzy rules and the corresponding normalized activation Respectively expressed as:
[0110] ;
[0111] ;
[0112] in, Represents the training sample set Middle Image samples No. Features.
[0113] Step 3-1-3: According to the normalized activation of each TSK fuzzy rule corresponding to each image sample in the training sample set, determine the antecedent matrix of the training sample set, where the training sample set The antecedent matrix The Row Elements Expressed as:
[0114] ;
[0115] in, Represents matrix transpose.
[0116] Step 3-1-4: According to the antecedent matrix of the training sample set, use the least squares method to determine the consequent vector of the TSK fuzzy rule, where The consequent vector of the TSK fuzzy rule corresponding to the layer subunit Expressed as: ;
[0117] in, Represents the training set The corresponding true label set; is a column vector with dimension size ,and:
[0118] ;
[0119] in, For the The consequent of the first TSK fuzzy rule corresponding to the layer subunit includes the 0th, 1st, ..., elements, Respectively The consequent of the second TSK fuzzy rule corresponding to the layer subunit includes the 0th, 1st, ..., elements, Respectively The layer subunit corresponds to The consequent of each TSK fuzzy rule includes the 0th, 1st, ..., elements.
[0120] Step 3-1-5: Convert the consequent vector of the TSK fuzzy rule into the consequent matrix of the corresponding TSK fuzzy rule, where The consequent matrix of the TSK fuzzy rule corresponding to the layer subunit Expressed as:
[0121] .
[0122] Step 3-1-6: According to the consequent matrix of TSK fuzzy rules, determine the TSK fuzzy rule association matrix, where TSK fuzzy rule association matrix corresponding to the layer sub-unit Expressed as:
[0123] ;
[0124] in, The dimension size is , the first Each element in the row represents the Layer subunit The degree of correlation between TSK fuzzy rules and each TSK fuzzy rule, among which The first The element is the largest, representing the Layer subunit The TSK fuzzy rule has the highest correlation with itself; Indicates the The enhanced TSK fuzzy rule consequent matrix corresponding to the layer subunit is: Indicates that and The product of is normalized by row, when hour, .
[0125] Specifically, for the sub-units except the first layer, since the calculation of the correlation matrix requires the use of the enhanced TSK fuzzy rule consequent matrix corresponding to the sub-units in the previous layer, the sub-units except the last layer need to transfer their corresponding enhanced TSK fuzzy rule consequent matrix to the sub-units in the next layer connected to them. For example, Figure 3 As shown, the first layer subunit, i.e., subunit 1, needs to transform its corresponding enhanced TSK fuzzy rule consequent matrix Pass it to the second-level subunit, that is, subunit 2. The second-level subunit, that is, subunit 2, needs to have its corresponding enhanced TSK fuzzy rule consequent matrix Passed to the third layer subunit, that is, subunit 3. Layer subunits It is necessary to use the corresponding enhanced TSK fuzzy rule consequent matrix Pass to Layer subunits . No. Layer subunits It is necessary to use the corresponding enhanced TSK fuzzy rule consequent matrix Pass to Layer subunits . No. Layer subunits It is necessary to use the corresponding enhanced TSK fuzzy rule consequent matrix Pass to Layer subunits .
[0126] Step 3-1-7: According to the TSK fuzzy rule association matrix, determine the corresponding enhanced TSK fuzzy rule consequent matrix, where The consequent matrix of the enhanced TSK fuzzy rule corresponding to the layer subunit Expressed as: .
[0127] Step 3-1-8: The consequent matrix of the enhanced TSK fuzzy rule corresponding to the layer subunit Convert the dimension size into The column vector of the corresponding enhanced TSK fuzzy rule is the consequent vector .
[0128] Exemplarily, in step S130, based on the enhanced TSK fuzzy rule consequent, determining the prediction result of each image sample in the input training sample set includes: determining the prediction result of each image sample in the input training sample set according to the enhanced TSK fuzzy rule consequent vector; wherein, The training sample set determined by the layer subunit Middle Image samples The prediction results Expressed as:
[0129] .
[0130] Specially, combined Figure 3 , as the last layer of subunits Layer subunits , which targets the input training sample set The output prediction result can be recorded as , and the prediction results It is also a deep fuzzy classifier, i.e., an image classification model, for the training set The prediction results, the prediction results Includes image classification model for training set The prediction results for each image sample in .
[0131] Exemplarily, in step S130, the training sample set is updated based on the prediction result of each image sample in the training sample set and the training error gradient determined by the importance fuzzy rule, including the following steps 3-2-1 to 3-2-4.
[0132] Step 3-2-1: TSK fuzzy rule association matrix corresponding to the layer sub-unit Calculate the sum of matrix elements by column. The TSK fuzzy rules corresponding to the maximum sum values are determined as Layer subunits corresponding to importance fuzzy rules. TSK fuzzy rule association matrix corresponding to the layer sub-unit No. The sum of the column elements reflects the Layer subunit TSK fuzzy rules in all R The importance of the TSK fuzzy rules, so the first rule with the largest sum value is The TSK fuzzy rule is determined as Layer subunits corresponding to Importance fuzzy rules.
[0133] Step 3-2-2: Use the importance fuzzy rule to determine the training error gradient, where Layer subunits target the training sample set Middle Image samples The training error gradient Expressed as:
[0134] ;
[0135] in, Indicates the Layer subunits target the training sample set Middle Image samples The output error and , Represents the training sample set Middle Image samples The true label, The Elements Expressed as:
[0136] ;
[0137] in, Represents the training sample set Middle Image samples The corresponding The normalized activation of the importance fuzzy rules, Represents the training sample set Middle Image samples The corresponding The calculation results of the importance fuzzy rules and ,in, Respectively represent the The layer subunit corresponds to The consequents of the importance fuzzy rules include the 0th, 1st, 2nd, ..., elements, The training sample sets are Middle Image samples 1st, 2nd, ..., Features, Indicates the Layer subunit The importance fuzzy rule corresponding to The center of the Gaussian membership function, Indicates the Layer subunit The importance fuzzy rule corresponding to The kernel width of the Gaussian membership function, Indicates the Layer subunit The importance fuzzy rule corresponding to The center of the Gaussian membership function, Indicates the Layer subunit The importance fuzzy rule corresponding to The kernel width of the Gaussian membership function, Indicates the The layer subunit corresponds to The consequent of the importance fuzzy rule includes elements.
[0138] Step 3-2-3: Construct the training error gradient matrix based on the training error gradient, where The training error gradient matrix corresponding to the layer sub-unit No. The row element is Layer subunits target the training sample set Middle Image samples The training error gradient .
[0139] Step 3-2-4: Use the training error gradient matrix to update the input training sample set, where The updated training sample set corresponding to the layer sub-unit Expressed as:
[0140] ;
[0141] in, Represents the feature learning rate, which is generally a small value. .
[0142] For example, if Figure 3 As shown, in the training phase, in addition to the training sample set of the first layer sub-unit, that is, sub-unit 1, For the training set In addition, the training sample sets input to the remaining sub-units are all updated training sample sets obtained by updating the input training sample sets using the training error gradient matrix of the previous layer sub-unit. For example, the training sample set input to the second layer sub-unit, that is, sub-unit 2, is , for subunit 1, using its corresponding training error gradient matrix For the input training sample set That is, the training set Update to get. Enter Layer subunits The training sample set , which is the subunit of the previous layer. Using its corresponding training error gradient matrix For the input training sample set Update to get. Subunit Using its corresponding training error gradient matrix For the input training sample set Update and get the training sample set , training sample set That is, input Layer subunits The training sample set of . Layer subunits The training sample set , which is the subunit of the previous layer. Using its corresponding training error gradient matrix For the input training sample set Update to get.
[0143] from Figure 3As can be seen from the figure, the specific cascade method of the two layers of sub-units during the training phase is as follows: the sub-units in the first layer pass their corresponding enhanced TSK fuzzy rule consequence matrix to the sub-units in the second layer. At the same time, the sub-units in the first layer update the input training sample set using the training error gradient matrix to obtain the updated training sample set, which is then passed to the sub-units in the second layer. The updated training sample set obtained by the sub-units in the first layer serves as the training sample set for the sub-units in the second layer. In this way, the image classification model can gradually improve the training accuracy of each layer of sub-units.
[0144] Step S140, in the testing phase, for each layer of sub-units: based on the enhanced TSK fuzzy rule consequences determined in the training phase, determine the prediction results of each image sample in the input test sample set; based on the prediction results of each image sample in the test sample set and the test error gradient determined by the importance fuzzy rule, update the test sample set, and use the updated test sample set as the test sample set input to the next layer of sub-units; wherein, the test sample set input to the first layer of sub-units is the test set.
[0145] Specifically, combined with Figure 2 In the test phase, first set m=1, and then perform the following steps in sequence: use the reinforced TSK fuzzy rule consequence obtained by the m-th layer sub-unit in the training phase to determine the classification result of the current input test sample set, that is, the prediction result for the current input test sample set; then calculate the gradient of the output error of the current sub-unit to the input test sample set based on the importance fuzzy rule of the m-th layer sub-unit, that is, the test error gradient, and add the gradient to the corresponding test sample feature to update the input test sample set; use the updated test sample set of the current sub-unit as the test sample set of the input sub-unit of the next layer; then let , at this time, if you are not satisfied , then execute each step of the test phase again, otherwise the test phase ends.
[0146] Exemplarily, in step S140, based on the enhanced TSK fuzzy rule consequence determined in the training phase, the prediction result of each image sample in the input test sample set is determined, including the following steps 4-1-1 to 4-1-3.
[0147] Step 4-1-1: According to the antecedents of the TSK fuzzy rules determined in the training phase, determine the activation degree and corresponding normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the input test sample set, where the input Test sample set of layer subunits Middle Image samples The corresponding The activation degree of TSK fuzzy rules and the corresponding normalized activation Respectively expressed as:
[0148] ;
[0149] ;
[0150] in, Represents the test sample set Middle Image samples No. Features.
[0151] Step 4-1-2: Determine the antecedent matrix of the test sample set according to the normalized activation of each TSK fuzzy rule corresponding to each image sample in the test sample set, where the test sample set The antecedent matrix The Row Elements Expressed as:
[0152] .
[0153] Step 4-1-3: Determine the prediction result of each image sample in the input test sample set based on the antecedent matrix of the test sample set and the consequent vector of the enhanced TSK fuzzy rule determined in the training phase, where Test sample set determined by layer subunit Middle Image samples The prediction results Expressed as: .
[0154] Specifically, since each subunit needs to use the enhanced TSK fuzzy rule consequent vector determined in the training phase when determining the prediction result of the input test sample set, it is necessary to transfer the enhanced TSK fuzzy rule consequent vector determined in the training phase to the test phase. Figure 4 For the first layer subunit, i.e. subunit 1, in addition to the need to input its test sample set In addition, it is also necessary to input the enhanced TSK fuzzy rule consequence vector determined in the training phase For the second layer subunit, that is, subunit 2, in addition to the need to input its test sample set In addition, it is also necessary to input the enhanced TSK fuzzy rule consequence vector determined in the training phase For the Layer subunits For example, in addition to the need to input its test sample set In addition, it is also necessary to input the enhanced TSK fuzzy rule consequence vector determined in the training phase For the Layer subunits For example, in addition to the need to input its test sample set In addition, it is also necessary to input the enhanced TSK fuzzy rule consequence vector determined in the training phase .
[0155] Specially, combined Figure 4 , as the last layer of subunits Layer subunits , which targets the input test sample set The output prediction result can be recorded as , and the prediction results Also for the deep fuzzy classifier, i.e. the image classification model, for the test set The prediction results, the prediction results Includes image classification model for test set The prediction results for each image sample in .
[0156] Exemplarily, in step S140, the test sample set is updated based on the prediction result of each image sample in the test sample set and the test error gradient determined by the importance fuzzy rule, including:
[0157] Step 4-2-1: Determine the test error gradient using the importance fuzzy rule, where Layer subunit for the test sample set Middle Image samples The test error gradient Expressed as:
[0158] ;
[0159] in, Indicates the Layer subunit for the test sample set Middle Image samples The output error and , Indicates the Test sample set determined by layer subunit Middle Image samples The prediction results, when hour, is the true label of an image sample randomly selected from the training set.
[0160] Step 4-2-2: Construct the test error gradient matrix based on the test error gradient, where The test error gradient matrix corresponding to the layer sub-unit No. The row element is Layer subunit for the test sample set Middle Image samples The test error gradient .
[0161] Step 4-2-3: Use the test error gradient matrix to update the input test sample set, where Updated test sample set corresponding to the layer subunit Expressed as:
[0162] .
[0163] For example, if Figure 4 As shown, in the test phase, in addition to the test sample set of the first layer sub-unit, that is, sub-unit 1, For the test set In addition, the test sample sets input to the remaining sub-units are all updated test sample sets obtained by updating the input test sample sets using the test error gradient matrix of the previous layer sub-unit. For example, the test sample set input to the second layer sub-unit, that is, sub-unit 2, is , for subunit 1, using its corresponding test error gradient matrix The input test sample set That is, the test set Update to get. Enter Layer subunits The test sample set , which is the subunit of the previous layer. Using its corresponding test error gradient matrix The input test sample set Update to get. Subunit Using its corresponding test error gradient matrix The input test sample set Update and get the test sample set , test sample set That is, input Layer subunits The test sample set of . Layer subunits The test sample set , which is the subunit of the previous layer. its corresponding test error gradient matrix the input test sample set is updated.
[0164] From Figure 4 it can be seen that the specific cascading manner of the two layers of sub-units in the test phase is that the previous layer of sub-units transmits the updated test sample set obtained by updating the input test sample set using the test error gradient matrix of the previous layer of sub-units to the next layer of sub-units, so as to take the updated test sample set obtained by the previous layer of sub-units as the test sample set input to the next layer of sub-units. Moreover, the training phase and the test phase of the same sub-unit also have a correlation relationship, which is specifically manifested as follows: the reinforced TSK fuzzy rule consequent vector obtained by the same sub-unit in the training phase needs to be transmitted to the test phase, so as to output the prediction result for the input test sample set in the test phase using the reinforced TSK fuzzy rule consequent vector obtained in the training phase. In this way, the image classification model can improve the test accuracy of each layer of sub-units layer by layer.
[0165] In order to enable those skilled in the art to better understand the above-mentioned embodiments, the following will be combined with Figure 5 , the steps performed by the first layer of sub-units in the training phase are specifically described.
[0166] As Figure 5 shown, in the training phase, the first layer of sub-units first obtains the antecedents of R pieces of TSK fuzzy rules for the image classification data set using the FCM algorithm, and specifically, the center and kernel width of the Gaussian membership function included in each piece of TSK fuzzy rule antecedent can be obtained according to the steps 3-1-1 in the above-mentioned embodiment when m = 1. Then, the first layer of sub-units calculates the consequent vectors of the corresponding R pieces of TSK fuzzy rules and forms the corresponding consequent matrix , wherein the consequent vector and the consequent matrix can be obtained according to the steps 3-1-2 to 3-1-5 in the above-mentioned embodiment when m = 1. Then, the first layer of sub-units sets and calculates the association matrix between the R pieces of TSK fuzzy rules based on the consequent matrix of the current layer of sub-units, wherein the association matrix can be calculated according to the step 3-1-6 in the above-mentioned embodiment when m = 1. Then, the first layer of sub-units calculates the reinforced TSK fuzzy rule consequent matrix using the association matrix It can be calculated according to step 3-1-7 in the above embodiment when m=1. Then, the first layer sub-unit determines the input training sample set That is, the training set The prediction results of the training sample set Middle Image samples The prediction results According to Get, among them, is the training sample set In the antecedent matrix of The row elements, This can be determined according to step 3-1-8 in the above embodiment when m=1. Then, the first layer sub-unit uses the association matrix Determine the corresponding The importance fuzzy rules can be obtained according to step 3-2-1 in the above embodiment when m=1. Then, the first layer sub-unit is based on The importance fuzzy rules form the training error gradient matrix , which can be obtained from steps 3-2-2 to 3-2-3 in the above implementation method when m=1. Finally, the first layer sub-unit uses the training error gradient matrix Update the input training sample set , so that the updated training sample set is used as the training sample set of the input next layer sub-unit, i.e., the second layer sub-unit, wherein the updated training sample set can be obtained according to steps 3-2-4 in the above implementation method when m=1.
[0167] In order to verify the actual effect of the image classification model provided by the above embodiment of the present disclosure, the number of layers of sub-units included in the image classification model is set to 5, and the image classification model is trained using the CIFAR10 image set. The training accuracy and test accuracy of the sub-units in each layer are shown in Table 1 below. The CIFAR10 image set contains 60,000 images, which are divided into 10 image categories, and each image category contains 6,000 images. Figure 6 As shown in the figure, the CIFAR10 image set includes 10 image categories: airplane, car, bird, cat, deer, dog, fox, horse, ship, and truck. Figure 6 Each row of images shown in corresponds to the above 10 image categories.
[0168] Table 1 Training accuracy and test accuracy of each layer sub-unit in the image classification model
[0169]
[0170] As can be seen from Table 1 above, in the image classification model, the training accuracy and test accuracy of each sub-unit have been improved layer by layer.
[0171] Using the CIFAR10 image set, the image classification model provided by the above embodiment of the present disclosure, the existing deep model classifier 1 (S. Gu et al., Fast training of adversarial deep fuzzy classifier by downsizing fuzzy rules with gradient guided learning[J]. IEEE Transactions on Fuzzy Systems, 2022, 30(6): 1967-1980), and the existing deep fuzzy classifier 2 (S. Gu et al., A novel deep fuzzy classifier by stacking adversarialinterpretable TSK fuzzy sub-classifiers with smooth gradient information[J]. IEEE Transactions on Fuzzy Systems, 2020, 28(7)) are trained respectively, and the training accuracy and test accuracy are shown in Table 2 below.
[0172] Table 2 Performance comparison between the image classification model disclosed in this paper and the existing deep fuzzy classifier
[0173]
[0174] As can be seen from Table 2 above, compared with the existing deep fuzzy classifier 1 and the existing deep fuzzy classifier 2, the image classification model disclosed in the present invention has improved both training accuracy and test accuracy, achieving a higher level of performance.
[0175] The training method for an image classification model provided by the embodiments of the present disclosure, compared to the prior art, uses multiple TSK fuzzy classifiers as a layer of sub-units, and constructs the multi-layer sub-units into an image classification model through a layer-by-layer cascade method. The TSK fuzzy rules that have a significant impact on the performance of the image classification model are used to update the input of each layer of sub-units layer by layer based on the importance fuzzy rules determined based on the correlation between the TSK fuzzy rules. Since the correlation between the TSK fuzzy rules is taken into account, the TSK fuzzy rules that have a greater impact on the classification performance of the image classification model will have a greater weight, and the use of the importance fuzzy rules to update the input of the sub-units layer by layer can improve the distinguishability of samples of different classes. Therefore, the image classification model can effectively improve the classification performance layer by layer and has excellent generalization ability, so that the image classification model can achieve a higher level of performance when solving the classification problem of large-scale images, thereby improving the classification accuracy of large-scale images.
[0176] Another embodiment of the present disclosure relates to an image classification method, including: obtaining an image dataset to be classified, wherein the image dataset to be classified includes multiple images to be classified; and classifying the images to be classified in the image dataset to be classified using an image classification model trained using the image classification model training method described in the above embodiment.
[0177] The image classification method provided by the embodiments of the present disclosure can effectively improve the classification accuracy of large-scale images compared to the existing technology.
[0178] Another embodiment of the present disclosure relates to a training device for an image classification model, including an acquisition module, a construction module, a training module, and a testing module.
[0179] The acquisition module is used to obtain an image classification dataset and randomly divide the image classification dataset into a training set and a test set in proportion, wherein the image classification dataset includes multiple image samples carrying real labels;
[0180] The construction module is used to treat multiple TSK fuzzy classifiers as a sub-unit, and construct multiple sub-units into an image classification model by cascading them layer by layer.
[0181] The training module is used to execute the training phase. For each layer of sub-units: based on the correlation between TSK fuzzy rules, the corresponding enhanced TSK fuzzy rule consequences are determined; based on the enhanced TSK fuzzy rule consequences, the prediction results of each image sample in the input training sample set are determined; based on the prediction results of each image sample in the training sample set and the training error gradient determined by the importance fuzzy rule, the training sample set is updated, and the updated training sample set is used as the training sample set for the input sub-units of the next layer; among them, the training sample set input to the first layer of sub-units is the training set.
[0182] The testing module is used to execute the testing phase. For each layer of sub-units: based on the enhanced TSK fuzzy rule consequences determined in the training phase, the prediction results of each image sample in the input test sample set are determined; based on the prediction results of each image sample in the test sample set and the test error gradient determined by the importance fuzzy rule, the test sample set is updated, and the updated test sample set is used as the test sample set for the next layer of sub-units; among them, the test sample set input to the first layer of sub-units is the test set.
[0183] The specific implementation method of the training device of the image classification model provided by the embodiment of the present disclosure can be found in the training method of the image classification model provided by the embodiment of the present disclosure, and will not be repeated here.
[0184] The training device for an image classification model provided by the embodiment of the present disclosure, compared to the prior art, uses multiple TSK fuzzy classifiers as a layer of sub-units, and constructs the multi-layer sub-units into an image classification model through a layer-by-layer cascade method. The TSK fuzzy rules that have a significant impact on the performance of the image classification model are used to update the input of each layer of sub-units layer by layer based on the importance fuzzy rules determined based on the correlation between the TSK fuzzy rules. Since the correlation between the TSK fuzzy rules is taken into account, the TSK fuzzy rules that have a greater impact on the classification performance of the image classification model will have a greater weight, and the use of the importance fuzzy rules to update the input of the sub-units layer by layer can improve the distinguishability of samples of different classes. Therefore, the image classification model can effectively improve the classification performance layer by layer and has excellent generalization ability, so that the image classification model can achieve a higher level of performance when solving the classification problem of large-scale images, thereby improving the classification accuracy of large-scale images.
[0185] Another embodiment of the present disclosure relates to an image classification device, including an image acquisition module and a classification module.
[0186] The image acquisition module is used to acquire a dataset of images to be classified, which includes multiple images to be classified.
[0187] The classification module is used to classify the images to be classified in the image data set using the image classification model trained by the image classification model training method of the above embodiment or the image classification model trained by the image classification model training device of the above embodiment.
[0188] The specific implementation method of the image classification device provided in the embodiment of the present disclosure can be found in the description of the image classification method provided in the embodiment of the present disclosure, and will not be repeated here.
[0189] The image classification device provided by the embodiments of the present disclosure can effectively improve the classification accuracy of large-scale images compared to the existing technology.
[0190] Another embodiment of the present disclosure relates to an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the image classification model training method or image classification method described in the above embodiment.
[0191] The memory and processor are connected using a bus, which can include any number of interconnected buses and bridges. The bus connects various circuits of one or more processors and memories. The bus can also connect various other circuits such as peripheral devices, voltage regulators, and power management circuits. These are all well known in the art and are therefore not described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single component or multiple components, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over a wireless medium via an antenna. Furthermore, the antenna receives data and transmits it to the processor.
[0192] The processor is responsible for managing the bus and general processing, and can also provide various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory can be used to store data used by the processor when performing operations.
[0193] Another embodiment of the present disclosure relates to a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the image classification model training method or image classification method described in the above embodiment.
[0194] That is, those skilled in the art will understand that all or part of the steps in the methods described in the above embodiments can be implemented by instructing related hardware through a program. The program is stored in a storage medium and includes a number of instructions for causing a device (such as a microcontroller or chip) or a processor to execute all or part of the steps in the methods described in the various embodiments of the present disclosure. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0195] Another embodiment of the present disclosure relates to a computer program product, including a computer program, which, when executed by a processor, implements the image classification model training method or image classification method described in the above embodiment.
[0196] Those skilled in the art will appreciate that the above-mentioned embodiments are specific embodiments for implementing the present disclosure, and that in actual applications, various changes may be made thereto in form and detail without departing from the spirit and scope of the present disclosure.
Claims
1. A training method for an image classification model, characterized in that: The training method of the image classification model includes: Obtain an image classification dataset, and randomly divide the image classification dataset into a training set and a test set in proportion, wherein the image classification dataset includes a plurality of image samples carrying real labels; Multiple TSK fuzzy classifiers are used as a layer of sub-units respectively, and the sub-units are constructed into an image classification model by cascading them layer by layer; During the training phase, for each layer of sub-units: based on the correlation between TSK fuzzy rules, the corresponding enhanced TSK fuzzy rule consequences are determined; based on the enhanced TSK fuzzy rule consequences, the prediction results of each image sample in the input training sample set are determined; based on the prediction results of each image sample in the training sample set and the training error gradient determined by the importance fuzzy rule, the training sample set is updated, and the updated training sample set is used as the training sample set for the next layer of sub-units; wherein, the training sample set for the first layer of sub-units is the training set; In the testing phase, for each layer of sub-units: based on the enhanced TSK fuzzy rule consequences determined in the training phase, a prediction result for each image sample in the input test sample set is determined; based on the prediction result of each image sample in the test sample set and the test error gradient determined by the importance fuzzy rule, the test sample set is updated, and the updated test sample set is used as the test sample set for the next layer of sub-units; wherein the test sample set for the first layer of sub-units is the test set; The determining of the corresponding enhanced TSK fuzzy rule consequent based on the association relationship between the TSK fuzzy rules includes: Generate the antecedents of TSK fuzzy rules using FCM algorithm; According to the antecedents of the TSK fuzzy rules, the activation degree and the corresponding normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the input training sample set are determined; According to the normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the training sample set, the antecedent matrix of the training sample set is determined; According to the antecedent matrix of the training sample set, the consequent vector of TSK fuzzy rule is determined by using the least square method. Convert the consequent vector of TSK fuzzy rule into the consequent matrix of corresponding TSK fuzzy rule; According to the consequent matrix of TSK fuzzy rules, determine the TSK fuzzy rule association matrix; According to the TSK fuzzy rule association matrix, the corresponding enhanced TSK fuzzy rule consequent matrix is determined.
2. The image classification model training method according to claim 1, characterized in that: No. The antecedents of the TSK fuzzy rules include: ; ; in, Indicates the Layer subunit The TSK fuzzy rule corresponds to the The center of the Gaussian membership function, satisfy , represents the total number of TSK fuzzy rules, satisfy , represents the total number of features for each image sample, Indicates input Training sample set of layer subunits and test sample set Subunit dataset The Image samples No. Features, satisfy , represents the total number of image samples included in the image classification dataset, Represents a subunit dataset The Image samples Belong to The membership degree of TSK fuzzy rules, Indicates the Layer subunit The TSK fuzzy rule corresponds to the The kernel width of the Gaussian membership function, represents the scale parameter; Training sample set Middle Image samples The corresponding The activation degree of TSK fuzzy rules and the corresponding normalized activation Respectively expressed as: ; ; in, Represents the training sample set Middle Image samples No. Features Training sample set The antecedent matrix The Row Elements Expressed as: ; in, Represents matrix transpose; No. The consequent vector of the TSK fuzzy rule corresponding to the layer subunit Expressed as: ; in, Represents the training set The corresponding true label set, is a column vector, and: ; in, For the The consequent of the first TSK fuzzy rule corresponding to the layer subunit includes the 0th, 1st, ..., elements, Respectively The consequent of the second TSK fuzzy rule corresponding to the layer subunit includes the 0th, 1st, ..., elements, Respectively The layer subunit corresponds to The consequent of each TSK fuzzy rule includes the 0th, 1st, ..., elements; No. The consequent matrix of the TSK fuzzy rule corresponding to the layer subunit Expressed as: ; No. TSK fuzzy rule association matrix corresponding to the layer sub-unit Expressed as: ; in, Indicates the The enhanced TSK fuzzy rule consequent matrix corresponding to the layer subunit is: Indicates that and The product of is normalized by row, when hour, ; No. The consequent matrix of the enhanced TSK fuzzy rule corresponding to the layer subunit Expressed as: ; The first The consequent matrix of the enhanced TSK fuzzy rule corresponding to the layer subunit Convert it into a column vector by row concatenation as the corresponding enhanced TSK fuzzy rule consequent vector .
3. The image classification model training method according to claim 2, characterized in that: The step of determining a prediction result for each image sample in the input training sample set based on the enhanced TSK fuzzy rule consequence comprises: According to the consequent vector of the enhanced TSK fuzzy rule, the prediction result of each image sample in the input training sample set is determined; Among them, The training sample set determined by the layer subunit Middle Image samples The prediction results Expressed as: 。 4. The image classification model training method according to claim 3, characterized in that: The updating of the training sample set based on the prediction result of each image sample in the training sample set and the training error gradient determined by the importance fuzzy rule includes: For the first TSK fuzzy rule association matrix corresponding to the layer sub-unit Calculate the sum of matrix elements by column. The TSK fuzzy rules corresponding to the maximum sum values are determined as Layer subunits corresponding to importance fuzzy rules; The importance fuzzy rule is used to determine the training error gradient, where Layer subunits target the training sample set Middle Image samples The training error gradient Expressed as: ; in, Indicates the Layer subunits target the training sample set Middle Image samples The output error and , Represents the training sample set Middle Image samples The true label, The Elements Expressed as: ; in, Represents the training sample set Middle Image samples The corresponding The normalized activation of the importance fuzzy rules, Represents the training sample set Middle Image samples The corresponding The calculation results of the importance fuzzy rules and ,in, Respectively represent the The layer subunit corresponds to The consequents of the importance fuzzy rules include the 0th, 1st, 2nd, ..., elements, The training sample sets Middle Image samples 1st, 2nd, ..., Features, Indicates the Layer subunit The importance fuzzy rule corresponding to The center of the Gaussian membership function, Indicates the Layer subunit The importance fuzzy rule corresponding to The kernel width of the Gaussian membership function, Indicates the Layer subunit The importance fuzzy rule corresponding to The center of the Gaussian membership function, Indicates the Layer subunit The importance fuzzy rule corresponding to The kernel width of the Gaussian membership function, Indicates the The layer subunit corresponds to The consequent of the importance fuzzy rule includes elements; The training error gradient matrix is constructed based on the training error gradient, where the first The training error gradient matrix corresponding to the layer sub-unit No. The row element is Layer subunits target the training sample set Middle Image samples The training error gradient ; The training error gradient matrix is used to update the input training sample set, where the first The updated training sample set corresponding to the layer subunit Expressed as: ; in, Represents the feature learning rate.
5. The image classification model training method according to claim 4, characterized in that: The step of determining a prediction result for each image sample in an input test sample set based on the enhanced TSK fuzzy rule consequence determined in the training phase includes: According to the antecedents of the TSK fuzzy rules determined in the training phase, the activation degree and the corresponding normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the input test sample set are determined, wherein the input Test sample set of layer subunits Middle Image samples The corresponding The activation degree of TSK fuzzy rules and the corresponding normalized activation Respectively expressed as: ; ; in, Represents the test sample set Middle Image samples No. Features According to the normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the test sample set, the antecedent matrix of the test sample set is determined, where the test sample set The antecedent matrix The Row Elements Expressed as: ; According to the antecedent matrix of the test sample set and the consequent vector of the enhanced TSK fuzzy rule determined in the training phase, the prediction result of each image sample in the input test sample set is determined, wherein the first Test sample set determined by layer subunit Middle Image samples The prediction results Expressed as: 。 6. The image classification model training method according to claim 5, characterized in that: The updating of the test sample set based on the prediction result of each image sample in the test sample set and the test error gradient determined by the importance fuzzy rule includes: The test error gradient is determined using the importance fuzzy rule, where Layer subunit for the test sample set Middle Image samples The test error gradient Expressed as: ; in, Indicates the Layer subunit for the test sample set Middle Image samples The output error and , Indicates the Test sample set determined by layer subunit Middle Image samples The prediction results, when hour, is the true label of an image sample randomly selected from the training set; The test error gradient matrix is constructed based on the test error gradient, where the first The test error gradient matrix corresponding to the layer sub-unit No. The row element is Layer subunit for the test sample set Middle Image samples The test error gradient ; The test error gradient matrix is used to update the input test sample set, where the first Updated test sample set corresponding to the layer subunit Expressed as: 。 7. The method for training an image classification model according to any one of claims 1 to 6, characterized in that: The obtaining of the image classification data set includes: Obtain multiple training images with real labels; Extracting features of each of the training images using a convolutional neural network to obtain corresponding image samples; The image samples are combined into the image classification dataset.
8. An image classification method, characterized in that: The image classification method comprises: Acquire a dataset of images to be classified, wherein the dataset includes a plurality of images to be classified; The images to be classified in the image data set to be classified are classified using an image classification model trained using the image classification model training method according to any one of claims 1 to 7.
9. A training device for an image classification model, characterized in that: The training device of the image classification model includes: An acquisition module is used to acquire an image classification dataset and randomly divide the image classification dataset into a training set and a test set in proportion, wherein the image classification dataset includes a plurality of image samples carrying real labels; A construction module, configured to use multiple TSK fuzzy classifiers as a sub-unit, and construct the multiple sub-units into an image classification model by cascading them layer by layer; A training module is configured to execute a training phase, for each layer of sub-units: based on the association relationship between TSK fuzzy rules, determine the corresponding enhanced TSK fuzzy rule consequences; based on the enhanced TSK fuzzy rule consequences, determine the prediction result of each image sample in the input training sample set; based on the prediction result of each image sample in the training sample set and the training error gradient determined by the importance fuzzy rule, update the training sample set, and use the updated training sample set as the training sample set input to the next layer of sub-units; wherein the training sample set input to the first layer of sub-units is the training set; A testing module is configured to execute a testing phase, for each layer of sub-units: determine a prediction result for each image sample in an input test sample set based on the reinforced TSK fuzzy rule consequence determined in the training phase; update the test sample set based on the prediction result for each image sample in the test sample set and a test error gradient determined by the importance fuzzy rule, and use the updated test sample set as the test sample set for the next layer of sub-units; wherein the test sample set for the first layer of sub-units is the test set; The determining of the corresponding enhanced TSK fuzzy rule consequent based on the association relationship between the TSK fuzzy rules includes: Generate the antecedents of TSK fuzzy rules using FCM algorithm; According to the antecedents of the TSK fuzzy rules, the activation degree and the corresponding normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the input training sample set are determined; According to the normalized activation degree of each TSK fuzzy rule corresponding to each image sample in the training sample set, the antecedent matrix of the training sample set is determined; According to the antecedent matrix of the training sample set, the consequent vector of TSK fuzzy rule is determined by using the least square method. Convert the consequent vector of TSK fuzzy rule into the consequent matrix of corresponding TSK fuzzy rule; According to the consequent matrix of TSK fuzzy rules, determine the TSK fuzzy rule association matrix; According to the TSK fuzzy rule association matrix, the corresponding enhanced TSK fuzzy rule consequent matrix is determined.
10. An image classification device, characterized in that: The image classification device comprises: An image acquisition module is used to acquire a dataset of images to be classified, wherein the dataset of images to be classified includes a plurality of images to be classified; A classification module is used to classify the images to be classified in the image data set to be classified using an image classification model trained by the training method of the image classification model described in any one of claims 1 to 7 or an image classification model trained by the training device of the image classification model described in claim 9.
Citation Information
Patent Citations
Adaptive rule pruning method for fuzzy system optimization
CN117973548A
Picture style classification method and system, electronic equipment and storage medium
CN118053045A