A Method, Device, Equipment and Storage Medium for Determining the Transferability of a Classification Model
By determining the class-related convolution kernel of each category of images in the classification model, calculating the feature vectors and evaluating the category separability, the problems of low efficiency and high resource consumption in the prior art are solved, and the model migration is efficiently evaluated.
Patent Information
- Application Number
- CN202310993319.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-08
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2043-08-08
AI Technical Summary
In the prior art, classification models have low efficiency in mobility assessment and consume computing resources, and cannot efficiently evaluate the adaptability and generalization capabilities of models in different fields, tasks or datasets.
By determining the class-related convolution kernel of each category of images in the classification model, calculating feature vectors and evaluating the class-separability, the mobility is evaluated, reducing the evaluation time and the consumption of computing resources.
Reduces evaluation time, saves computing resources, and improves evaluation efficiency and accuracy.
Smart Images

Figure CN117095260B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of classification model transferability assessment, and in particular to a classification model transferability determination method, apparatus, device and storage medium. Background Art
[0002] Model transferability assessment aims to verify the adaptability and generalization capabilities of a trained classification model across different domains, tasks, or datasets. The higher the transferability of a classification model, the better its performance on new tasks. Existing techniques for assessing model transferability use direct transfer, applying the classification model directly to the new task in question. Performance is then evaluated by testing accuracy and calculating evaluation metrics. However, this requires computing the entire new task data, which is inefficient and consumes computational resources. Summary of the Invention
[0003] The purpose of the present invention is to provide a method, device, equipment and storage medium for determining the transferability of a classification model, which is applied to the field of classification model transferability evaluation. The method determines the category-related convolution kernels of each category of images in the classification model, and then obtains the feature vectors of each category of images. The separability between the categories is calculated through the feature vectors to evaluate the transferability. Compared with inputting all new task data into the classification model and evaluating its transferability based on the test results, the method of the present invention reduces the evaluation time and saves computing resources.
[0004] To solve the above technical problems, the present invention provides a method for determining the transferability of a classification model, comprising:
[0005] Determine the category-related convolution kernels for each target category in the target task set;
[0006] Calculating the feature vector of the image in the target task set by using the category-related convolution kernel;
[0007] Calculating the class separability of each target class according to the feature vector;
[0008] Calculating the transferable value of the classification model to the target task set according to the class separability;
[0009] The transferability of the classification model is determined based on the transferability value.
[0010] Optionally, determining the category-related convolution kernel for each target category in the target task set includes:
[0011] Selecting a preset number of images from each category of the target task set to construct a category image set;
[0012] Calculating the feature maps of the category image set at each convolutional layer;
[0013] Calculating the importance coefficient of each convolution kernel to the target category according to the feature map;
[0014] The category-dependent convolution kernel of the target category is determined based on the importance coefficient.
[0015] Optionally, determining the category-related convolution kernel for each target category in the target task set includes:
[0016] Select a preset number of images from each category of the target task set to construct a category image set;
[0017] Calculating the feature maps of the category image set at each convolutional layer;
[0018] Calculating the importance coefficient of each convolution kernel to the target category according to the feature map;
[0019] The category-dependent convolution kernel of the target category is determined based on the importance coefficient.
[0020] Optionally, calculating the importance coefficient of each convolution kernel for the target category according to the feature map includes:
[0021] Calculating the first-order differential of the predicted category with respect to the feature map;
[0022] The first-order differential is input into a first model to calculate the importance coefficient of the convolution kernel. The expression of the first model is:
[0023]
[0024] in, is the importance coefficient of the kth convolution kernel in the rth convolution layer to the nth target category, is the sum operation of matrix elements, The nth predicted category The first-order differential of the kth feature map in the rth convolutional layer for the image x in the category image set.
[0025] Optionally, calculating the class separability of each target class according to the feature vector includes:
[0026] Calculating the mean and variance of the feature vectors of the images included in each target category;
[0027] The Bhattacharyya coefficient between the target categories is calculated according to the mean and the variance.
[0028] Optionally, calculating the mean and variance of the feature vectors of the images included in each target category includes:
[0029] The feature vectors of the images included in each target category are input into the second model to calculate the mean and the variance. The expression of the second model is:
[0030]
[0031] Among them, μ q is the mean of the feature vectors of the images contained in the target category q, ∑ q is the variance of the feature vector of the image contained in the target category q, N q represents the number of images contained in the target category q, is the eigenvector of the i-th image, T is the matrix transpose, y i is the target category of the i-th image.
[0032] Optionally, calculating the Bhattacharyya coefficient between the target categories according to the mean and the variance includes:
[0033] Determining whether each target category in the target task set obeys a Gaussian distribution;
[0034] If so, the Gaussian distribution of each target category is calculated based on the mean and the variance, and the Gaussian distribution is input into a third model to calculate the Bhattacharyya coefficient of each target category. The expression of the third model is:
[0035]
[0036] Among them, BC(q i ,q j ) is the target category q i and target category q j The Bhattacharyya coefficient, is the target category q i The Gaussian distribution, is the target category q j The Gaussian distribution of
[0037] If not, the mean and the variance are input into a fourth model to calculate the Bhattacharyya distance of each target category, and the Bhattacharyya coefficient of each target category is calculated according to the Bhattacharyya distance. The expression of the fourth model is:
[0038]
[0039] Among them, BD(q i ,qj ) is the target category q i With the target category q j The Bhattacharyya distance, is the target category q i the mean of the feature vectors of the included images, is the target category q i the variance of the eigenvector of the included image, is the target category q j the mean of the feature vectors of the included images, is the target category q j The variance of the feature vector of the included image.
[0040] Optionally, calculating the transferable value of the classification model to the target task set according to the class separability includes:
[0041] The Bhattacharyya coefficient is input into the fifth model to calculate the transferable value. The expression of the fifth model is:
[0042]
[0043] Among them, BC(q i ,q j ) is the target category q i With the target category q j The Bhattacharyya coefficient is , and OICS is the migration value.
[0044] To solve the above technical problems, the present invention provides a classification model transferability determination device, comprising:
[0045] The first module is used to determine the category-related convolution kernels for each target category in the target task set;
[0046] The second module is used to calculate the feature vector of the image in the target task set by using the category-related convolution kernel;
[0047] A third module is used to calculate the class separability of each target class according to the feature vector;
[0048] A fourth module is used to calculate the transferable value of the classification model for the target task set based on the class separability;
[0049] The fifth module is used to determine the transferability of the classification model based on the transferable value.
[0050] To solve the above technical problems, the present invention provides a method and device for determining the transferability of a classification model, comprising:
[0051] Memory for storing computer programs;
[0052] A processor is configured to implement any one of the methods for determining the transferability of a classification model when executing the computer program.
[0053] In order to solve the above technical problems, the present invention provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, any one of the methods for determining the transferability of a classification model is implemented.
[0054] It can be seen that the method of the present invention determines the category-related convolution kernels of each category of images in the classification model, and then obtains the feature vectors of each category of images. The separability between categories is calculated through the feature vectors to evaluate the transferability. Compared with inputting all new task data into the classification model and evaluating its transferability based on the test results, the method of the present invention reduces the evaluation time and saves computing resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0056] Figure 1 A flow chart of a method for determining the transferability of a classification model provided by an embodiment of the present invention;
[0057] Figure 2 A schematic diagram of determining a category-related convolution kernel provided by an embodiment of the present invention;
[0058] Figure 3 A schematic diagram of extracting a feature vector provided by an embodiment of the present invention;
[0059] Figure 4 This is a structural block diagram of a classification model transferability determination device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0061] The following combination Figure 1 , Figure 1 A flowchart of a method for determining the transferability of a classification model provided by an embodiment of the present invention may include:
[0062] S101: Determine the category-related convolution kernels for each target category in the target task set.
[0063] Model transferability assessment aims to verify the adaptability and generalization ability of a trained classification model in different domains, tasks, or datasets. This embodiment can determine the category-dependent convolution kernels for each target category in the target task set. For classification tasks, a specific category often has a high correlation with only a few specific convolution kernels. We call these convolution kernels category-dependent convolution kernels. Compared to using all convolution kernels, applying category-dependent convolution kernels can obtain more accurate feature maps of the input image.
[0064] This embodiment does not limit the specific method of determining the category-related convolution kernels for each target category. Generally speaking, the overall process can be as follows: Figure 2 As shown, assuming that the feature map of an input image x in the (r-1) layer of the network is represented as And the convolution kernel of the rth convolutional layer in the network is expressed as Then the feature map of the rth layer in the network is The calculation method can be shown as follows:
[0065]
[0066] in, represents the kth feature map of image x in the rth convolutional layer, is the kth convolution kernel of the rth convolution layer, K r Represents the number of convolution kernels in the rth convolution layer, T r represents the number of feature maps of the r-th convolutional layer, and K r =T r , ⊙ represents the convolution operation, and f(·) represents operations such as pooling and activation function.
[0067] The predicted category in this embodiment refers to the category predicted by the classification model for the image, and the target category is the true category of the image. The predicted category in this embodiment can be determined by the output value of the image input classification model. For example, when the second predicted category When the corresponding output value is the largest, the output value is set to 1, and the other values are set to 0, and As the predicted category of image x, the predicted category The relationship between the feature map of the rth convolutional layer in the network can be expressed as: Where G can represent operations such as convolution, pooling, activation function and fully connected layer.
[0068] This embodiment can select a preset number of images from the images of each target category in the target task set to construct a category image set, and then calculate the feature map of each image in each convolution layer in the category image set. For example, the first-order differential of the k-th feature map of the r-th layer of image x can be expressed as:
[0069]
[0070] in, and Indicates the nth predicted category The first-order differential of the k-th feature map in the r-th convolutional layer for image x in the category image set.
[0071] According to the first-order differential, the importance coefficient of each convolution kernel for each target category can be further calculated. Specifically, the first-order differential can be input into the first model to calculate the importance coefficient of the convolution kernel. The expression of the first model is:
[0072]
[0073] in, For the kth convolution kernel in the rth convolution layer, the nth target category y n The importance coefficient of Sums the elements of a matrix.
[0074] This embodiment does not limit the specific operation of determining the category-related convolution kernel according to the importance coefficient. In this embodiment, an importance coefficient threshold can be set. When the importance coefficient threshold is greater than the value of the k-th convolution kernel of the r-th convolution layer, the n-th target category y n The category-related convolution kernel.
[0075] S102: Calculate the feature vector of the image in the target task set through the category-related convolution kernel.
[0076] After determining the category-related convolution kernel for each target category, the image of each target category in the target task set can be output with its feature map through the corresponding category-related convolution kernel, and the feature vector can be further extracted through the feature map. The process can be as follows: Figure 3 As shown, assuming that the category corresponding to image x contains K category-related convolution kernels in the last convolution layer, the feature map of the last layer of image x is Where F(·) represents the input image feature map calculated based on the category-related convolution kernel, It represents the j-th category-related convolution kernel in the i-th convolutional layer of the network, and l is the number of convolutional layers in the classification model.
[0077] This embodiment does not limit the calculation method of each image feature vector. Generally, it can be calculated by the image embedding function of the classification model:
[0078]
[0079] Among them, v x is the eigenvector, f s (·) is the image embedding function.
[0080] The feature vector of the target dataset is finally obtained through the image embedding function.
[0081] S103: Calculate the class separability of each target class based on the feature vector.
[0082] In this embodiment, the class separability of each target class can be calculated based on the feature vector. This embodiment does not limit the specific calculation method. In statistics, the Bhattacharyya coefficient is an indicator that measures the similarity between two discrete probability distributions. The Bhattacharyya coefficient is generally used to measure the overlap between two statistical samples. In this embodiment, the Bhattacharyya coefficient (denoted as BC) can be used to represent the separability between two classes. The larger the BC coefficient, the greater the overlap between the two target classes and the lower the class separability.
[0083] In this embodiment, the mean and variance of the feature vectors of the images included in each target category can be calculated based on the feature vectors of each image. Specifically, the feature vectors of the images included in each target category can be input into the second model to calculate the mean and variance of the feature vectors of the images included in each target category. The expression of the second model is:
[0084]
[0085] Among them, μ q is the mean of the feature vectors of the images contained in the target category q, ∑ q is the variance of the feature vector of the image contained in the target category q, Nq represents the number of images contained in the target category q, is the eigenvector of the i-th image, T is the matrix transpose, y i is the target category of the i-th image.
[0086] After calculating the mean and variance corresponding to each target category, the BC coefficient can be calculated. This embodiment does not limit the specific calculation method. Generally, it can be determined whether each target category in the target task set obeys the Gaussian distribution. If so, the Gaussian distribution of each target category can be calculated:
[0087]
[0088] Among them, p q is the Gaussian distribution of target category q, is the representation of Gaussian distribution.
[0089] The Gaussian distribution is input into the third model to calculate the Bhattacharyya coefficient of each target category. The expression of the third model is:
[0090]
[0091] Among them, BC(q i ,q j ) is the target category q i and target category q j The Bhattacharyya coefficient and OICS are transferable values.
[0092] If there are target categories that do not satisfy the Gaussian distribution, the mean and variance can be input into the fourth model to calculate the Bhattacharyya distance of each target category, and the Bhattacharyya coefficient of each target category can be calculated based on the Bhattacharyya distance. The expression of the fourth model is:
[0093]
[0094] Among them, BD(q i ,q j ) is the target category q i and target category q j Bhattacharyya distance, is the target category q i The mean of the eigenvectors of the included images, is the target category q i The variance of the eigenvectors of the included images, is the target category q j The mean of the eigenvectors of the included images, is the target category q j The variance of the eigenvectors of the included images.
[0095] The Bhattacharyya distance (denoted as BD) is used to measure the similarity between two probability distributions and is closely related to the Bhattacharyya coefficient. In this embodiment, the Bhattacharyya coefficient can be calculated using the Bhattacharyya distance:
[0096] BC(q i ,q j )=exp-BD(q i ,q j );
[0097] Where exp is an exponential function with the natural constant e as the base.
[0098] In this embodiment, the target category q, target category q i and target category q j They are all reference forms of target categories and do not refer to a fixed target category.
[0099] S104: Calculate the transferability value of the classification model to the target task set based on the category separability.
[0100] S105: Determine the transferability of the classification model based on the transferability value.
[0101] In this embodiment, the transferable value of the classification model for the target task set can be calculated based on the class separability. This embodiment does not limit the specific type of the transferable value, and it can generally be represented by OICS (overall inter-class similarity of the target dataset). The Bhattacharyya coefficient is input into the fifth model to calculate the transferable value OICS. The expression of the fifth model is:
[0102]
[0103] After calculating the transferability value OICS of the classification model to the target task data based on the class separability, this embodiment can determine the model transferability through OICS. This embodiment does not limit the specific determination method. Since the larger the BC coefficient, the greater the overlap between the two target classes and the lower the class separability, in this embodiment, the smaller the OICS value, the better the performance of the classification model to the target dataset and the higher the transferability of the classification model to the target dataset.
[0104] This embodiment does not limit the specific method for determining the transferability of the classification model based on the transferability value. Generally, the transferability of the classification model to the target dataset can be directly represented by the size of the value. Alternatively, the transferability can be divided by setting thresholds for each level, and the transferability score can be determined to which threshold interval it belongs, thereby determining the transferability level of the classification model. Alternatively, the transferability degree can be represented by converting the transferability value into a percentage. The specific determination method can be set according to the actual application scenario and needs.
[0105] This embodiment determines the category-related convolution kernels for each category of images in the classification model, and then obtains the feature vectors of each category of images. The separability between categories is calculated based on the feature vectors to evaluate the transferability. Compared with inputting all new task data into the classification model and evaluating its transferability based on the test results, the method of the present invention reduces the evaluation time and saves computing resources.
[0106] The following is a specific embodiment of a method for determining the transferability of a classification model provided by the present invention, which may include:
[0107] Select a preset number of images from each category of the target task set to construct a category image set;
[0108] Calculate the feature map of the category image set at each convolution layer, and calculate the importance coefficient of each convolution kernel to the target category based on the feature map;
[0109] Determine the category-related convolution kernel of the target category based on the importance coefficient, and calculate the feature vector of the image in the target task set through the category-related convolution kernel;
[0110] Calculate the variance and mean of the feature vector of each target category based on the feature vector, and calculate the BC coefficient based on the variance and mean;
[0111] The OICS value is calculated according to the BC coefficient, and the transferability of the classification model is determined based on the OICS value.
[0112] The following combination Figure 4 , Figure 4 This is a structural block diagram of a classification model transferability determination device provided by an embodiment of the present invention. The device may include:
[0113] The first module 100 is used to determine the category-related convolution kernels for each target category in the target task set;
[0114] The second module 200 is used to calculate the feature vector of the image in the target task set using the category-related convolution kernel;
[0115] The third module 300 is configured to calculate the class separability of each target class based on the feature vector;
[0116] The fourth module 400 is used to calculate the transferable value of the classification model to the target task set based on the class separability;
[0117] The fifth module 500 is used to determine the transferability of the classification model based on the transferable value.
[0118] Based on the above embodiments, the present invention determines the category-related convolution kernels of each category of images in the classification model, and then obtains the feature vectors of each category of images. The separability between the categories is calculated through the feature vectors to evaluate the transferability. Compared with inputting all the new task data into the classification model and evaluating its transferability based on the test results, the method of the present invention reduces the evaluation time and saves computing resources.
[0119] Based on the above embodiments, the first module 100 may include:
[0120] A category image set unit, configured to select a preset number of images from each category of images in the target task set to construct a category image set;
[0121] A feature map unit, used to calculate the feature map of the category image set at each convolutional layer;
[0122] An importance coefficient unit, configured to calculate the importance coefficient of each convolution kernel for the target category based on the feature map;
[0123] A determining unit is used to determine the category-related convolution kernel of the target category based on the importance coefficient.
[0124] Based on the above embodiments, the importance coefficient unit may include:
[0125] A first-order differential molecular unit, used to calculate the first-order differential of the predicted category with respect to the feature map;
[0126] The first model subunit is configured to input the first-order differential into a first model to calculate the importance coefficient of the convolution kernel, wherein the expression of the first model is:
[0127]
[0128] in, is the importance coefficient of the kth convolution kernel in the rth convolution layer to the nth target category, is the sum operation of matrix elements, The nth predicted category The first-order differential of the kth feature map in the rth convolutional layer for the image x in the category image set.
[0129] Based on the above embodiments, the third module 300 may include:
[0130] a mean-variance unit, configured to calculate the mean and variance of the feature vectors of the images included in each target category;
[0131] A BC coefficient unit is configured to calculate a Bhattacharyya coefficient between each of the target categories based on the mean and the variance.
[0132] Based on the above embodiments, the mean-variance unit may include:
[0133] The second model subunit is configured to input the feature vector of the target task set into a second model to calculate the mean and the variance of each target category, wherein the expression of the second model is:
[0134]
[0135] Among them, μ q is the mean of the feature vectors of the images contained in the target category q, ∑ q is the variance of the feature vector of the image contained in the target category q, N q represents the number of images contained in the target category q, is the eigenvector of the i-th image, T is the matrix transpose, y i is the target category of the i-th image.
[0136] Based on the above embodiments, the BC coefficient unit may include:
[0137] A judgment subunit, configured to judge whether all target categories in the target task set obey Gaussian distribution; if so, execute the third model subunit; if not, execute the fourth model subunit;
[0138] The third model subunit is configured to calculate the Gaussian distribution of each target category based on the mean and the variance, and input the Gaussian distribution into a third model to calculate the Bhattacharyya coefficient of each target category. The expression of the third model is:
[0139]
[0140] Among them, BC(q i ,q j ) is the target category q i and target category q j The Bhattacharyya coefficient, is the target category q i The Gaussian distribution, is the target category q j The Gaussian distribution of
[0141] The fourth model subunit is configured to input the mean and the variance into a fourth model to calculate the Bhattacharyya distance of each target category, and calculate the Bhattacharyya coefficient of each target category based on the Bhattacharyya distance. The expression of the fourth model is:
[0142]
[0143] Among them, BD(q i ,q j ) is the target category q i With the target category q j The Bhattacharyya distance, is the target category q i the mean of the feature vectors of the included images, is the target category q i the variance of the eigenvector of the included image, is the target category q j the mean of the feature vectors of the included images, is the target category q j The variance of the feature vector of the included image.
[0144] Based on the above embodiments, the fourth module 400 may include:
[0145] The fifth model unit is configured to input the Bhattacharyya coefficient into a fifth model to calculate the transferable value. The expression of the fifth model is:
[0146]
[0147] Among them, BC(q i ,q j ) is the target category q i With the target category q j The Bhattacharyya coefficient is , and OICS is the migration value.
[0148] Based on the above embodiments, the present invention further provides a device, which may include a memory and a processor. The memory stores a computer program, and the processor, when invoking the computer program in the memory, can implement the steps provided in the above embodiments. Of course, the device may also include various necessary network interfaces, a power supply, and other components.
[0149] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by an execution terminal or a processor, can implement the method provided in an embodiment of the present invention; the storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program codes.
[0150] In this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus comprising the element.
[0151] The above is a detailed introduction to the method, device, equipment and storage medium for determining the portability of a classification model provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for determining the transferability of a classification model, characterized in that: include: Determine the category-related convolution kernels for each target category in the target task set; Calculating the feature vector of the image in the target task set by using the category-related convolution kernel; Calculating the class separability of each target class according to the feature vector; Calculating the transferable value of the classification model to the target task set according to the class separability; determining the transferability of the classification model based on the transferability value; Determining the category-related convolution kernels for each target category in the target task set includes: Selecting a preset number of images from each category of the target task set to construct a category image set; Calculating the feature maps of the category image set at each convolutional layer; Calculating the importance coefficient of each convolution kernel to the target category according to the feature map; Determining the category-dependent convolution kernel of the target category based on the importance coefficient; Calculating the importance coefficient of each convolution kernel to the target category according to the feature map includes: Calculating the first-order differential of the predicted category with respect to the feature map; The first-order differential is input into a first model to calculate the importance coefficient of the convolution kernel. The expression of the first model is: in, is the importance coefficient of the kth convolution kernel in the rth convolution layer to the nth target category, is the sum operation of matrix elements, The nth predicted category performing a first-order differential of the k-th feature map in the r-th convolutional layer of the image x in the category image set; when the importance coefficient is greater than an importance coefficient threshold, determining the k-th convolution kernel in the r-th convolutional layer as the category-related convolution kernel of the n-th target category; The calculating the class separability of each target class according to the feature vector includes: Calculating the mean and variance of the feature vectors of the images included in each target category; Calculating the Bhattacharyya coefficient between each of the target categories according to the mean and the variance; The calculating the transferable value of the classification model to the target task set according to the class separability includes: The Bhattacharyya coefficient is input into the fifth model to calculate the transferable value. The expression of the fifth model is: Among them, BC(q i ,q j ) is the target category q i With the target category q j The Bhattacharyya coefficient is , and OICS is the migration value.
2. The method for determining the transferability of a classification model according to claim 1, wherein: The calculating the mean and variance of the feature vectors of the images included in each target category includes: The feature vectors of the images included in each target category are input into the second model to calculate the mean and the variance. The expression of the second model is: Among them, μ q is the mean of the feature vectors of the images contained in the target category q, ∑ q is the variance of the feature vector of the image contained in the target category q, N q represents the number of images contained in the target category q, is the feature vector of the i-th image, is the matrix transpose, y i is the target category of the i-th image.
3. The method for determining the transferability of a classification model according to claim 1, wherein: Calculating the Bhattacharyya coefficient between the target categories according to the mean and the variance includes: Determine whether each target category in the target task set obeys a Gaussian distribution; If so, the Gaussian distribution of each target category is calculated based on the mean and the variance, and the Gaussian distribution is input into a third model to calculate the Bhattacharyya coefficient of each target category. The expression of the third model is: Among them, BC(q i ,q j ) is the target category q i and target category q j The Bhattacharyya coefficient, is the target category q i The Gaussian distribution, is the target category q j The Gaussian distribution of If not, the mean and the variance are input into a fourth model to calculate the Bhattacharyya distance of each target category, and the Bhattacharyya coefficient of each target category is calculated according to the Bhattacharyya distance. The expression of the fourth model is: Among them, BD(q i ,q j ) is the target category q i With the target category q j The Bhattacharyya distance, is the target category q i the mean of the feature vectors of the included images, is the target category q i the variance of the eigenvector of the included image, is the target category q j the mean of the feature vectors of the included images, is the target category q j The variance of the feature vector of the included image.
4. A device for determining the transferability of a classification model, characterized in that: include: The first module is used to determine the category-related convolution kernels for each target category in the target task set; The second module is used to calculate the feature vector of the image in the target task set by using the category-related convolution kernel; A third module is used to calculate the class separability of each target class according to the feature vector; A fourth module is used to calculate the transferable value of the classification model for the target task set based on the class separability; A fifth module, configured to determine the transferability of the classification model based on the transferable value; Determining the category-related convolution kernels for each target category in the target task set includes: Selecting a preset number of images from each category of the target task set to construct a category image set; Calculating the feature maps of the category image set at each convolutional layer; Calculating the importance coefficient of each convolution kernel to the target category according to the feature map; Determining the category-related convolution kernel of the target category based on the importance coefficient; calculating the importance coefficient of each convolution kernel for the target category according to the feature map, including: Calculating the first-order differential of the predicted category with respect to the feature map; The first-order differential is input into a first model to calculate the importance coefficient of the convolution kernel. The expression of the first model is: in, is the importance coefficient of the kth convolution kernel in the rth convolution layer to the nth target category, is the sum operation of matrix elements, The nth predicted category performing a first-order differential of the k-th feature map in the r-th convolutional layer of the image x in the category image set; when the importance coefficient is greater than an importance coefficient threshold, determining the k-th convolution kernel in the r-th convolutional layer as the category-related convolution kernel of the n-th target category; The calculating the class separability of each target class according to the feature vector includes: Calculating the mean and variance of the feature vectors of the images included in each target category; Calculating the Bhattacharyya coefficient between each of the target categories according to the mean and the variance; The calculating the transferable value of the classification model to the target task set according to the class separability includes: The Bhattacharyya coefficient is input into the fifth model to calculate the transferable value. The expression of the fifth model is: Among them, BC(q i ,q j ) is the target category q i With the target category q j The Bhattacharyya coefficient is , and OICS is the migration value.
5. A method and device for determining the transferability of a classification model, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the method for determining the transferability of a classification model as claimed in any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the method for determining the transferability of a classification model as described in any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
Measurement method and device for transfer learning application feasibility
CN107392321A
Image classification neural network model building and image classification methods and devices
CN108805166A