Method for searching and multiplexing learning items for image classification task

Through text representation and abbreviated kernel mean embedding technology, the prediction results and confidence of the image classification model are converted into a unified feature space, and a learning library is constructed to solve the problem of model reuse and search in the image classification task, and realize the resource Efficient model adaptation and deployment.

CN118691874AActive Publication Date: 2024-09-24NANJING UNIV

Patent Information

Application Number
CN202410684501.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-09-24
Estimated Expiration
2044-05-30

AI Technical Summary

Technical Problem

It is difficult to effectively reuse image classification models in image classification tasks with existing technologies, especially in resource-constrained environments, and existing model search methods cannot consider model performance and data distribution at the same time, and cannot effectively convert different data distributions and features. model of space.

Method used

The text representation method is used to convert the model's prediction categories and confidence into text form, and the text-image pre-training model is used to convert the image and text data into a unified feature space. It is combined with the abbreviated kernel mean embedding technology to construct the protocol and form a learning library. , to achieve accurate search and reuse of models.

Benefits of technology

It improves the model's performance and resource utilization efficiency on new tasks, significantly optimizes the model search and deployment process, and can quickly locate and adapt the most suitable model to solve new tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691874A
    Figure CN118691874A
Patent Text Reader

Abstract

The invention discloses a learning document searching and multiplexing method for an image classification task, which is characterized in that unified data representation is carried out by utilizing a text-image pre-training model in a learning document protocol construction process, training data distribution and model performance are considered at the same time, the model function description accuracy of a learning document protocol is improved, and the learning document protocol construction efficiency is improved. Therefore, search and reuse of the model can be better realized through the protocol in the face of a new image classification task. According to the method, the learning document library composed of a large number of image classification models and the model protocols generated by using the method is constructed, when a user faces a new image classification task, efficient model searching can be performed in the learning document library through the learning document protocols generated by the method, and the model which can well express in the task of the user can be accurately found.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for searching and reusing learning documents for image classification tasks, and belongs to the technical fields of machine learning and image classification. Background Art

[0002] In the field of image classification, the mainstream method to quickly build machine learning models for new image classification tasks and avoid collecting a large amount of data from scratch for model training is to pre-train large-scale pre-trained models with huge parameters on large-scale image classification data, and then fine-tune the pre-trained models using specific downstream task data. However, these large pre-trained models have a large number of parameters, and even fine-tuning the models on new tasks requires a lot of computing resources. Therefore, this method faces the problems of poor applicability and unsatisfactory efficiency in resource-constrained tasks. In addition, although large pre-trained models have strong versatility, their performance on specific downstream tasks cannot reach the optimal level. Therefore, for specific downstream image classification tasks, using large pre-trained models for fine-tuning is not the best choice. At the same time, in the development of machine learning, a large number of image classification data sets and domain-specific models for solving various image classification tasks have been generated. When facing new image classification tasks, if the existing specialized models can be effectively reused, the demand for resources will be greatly reduced, while the performance on new tasks will be improved. However, existing model reuse methods all assume that one or more reusable models are already given. In practical applications, how to select the most suitable model for the target task from a large number of candidate models is a very difficult problem. Some existing work has considered estimating the performance of the model on the target task by building proxy indicators to assist in model selection. Then these works need to predict and output all candidate models one by one in the target task data, which is difficult to apply when the number of candidate models is large. Related research on learning software proposes to describe the function of the model by assigning specifications to the model, and to achieve efficient model search by matching new tasks with existing model specifications. However, the existing model specifications only consider the distribution of model training data. The reusability of the model is not only affected by the data distribution, but also by the performance of the model itself. How to consider both data distribution and model performance at the same time is a defect of existing learning software search technology. In addition, existing learning software search technology mainly targets data with homogeneous features. How to convert image classification models from different data distributions and heterogeneous feature spaces into a unified feature space for representation is still an unresolved problem. Summary of the invention

[0003] Purpose of the invention: In view of the problems and shortcomings existing in the prior art, the present invention provides a method for searching and reusing learning materials for image classification tasks, aiming to construct a specification for the image classification model that can accurately characterize the model function, collect a large number of image classification models and generate specifications for them to build a learning material library, so that users can search and reuse models in the learning material library, thereby solving new image classification tasks better and faster.

[0004] The core technologies of the present invention include: 1) a text representation method for image classification model performance, which obtains the predicted category and corresponding confidence of the model on the training data and converts it into text form; 2) a method for constructing image classification model specifications that simultaneously considers the distribution of training data and model performance. Based on the text-image pre-training model, the method converts feature heterogeneous training image data from different tasks into a new feature space through an image encoder, and converts the prediction results and confidence of the model on the respective training data into a new feature space through a text encoder; then aligns the image space and the text space, and constructs a specification through reduced kernel mean embedding (RKME) in the aligned text-image representation space, so as to simultaneously characterize the distribution of training data and the performance of the model on the training data in the new feature space; 3) In addition, the present invention also provides a detailed method for constructing a learning library and learning search. The present invention is aimed at image classification tasks, and by simultaneously considering the distribution of training data and model performance, it can efficiently and accurately realize accurate search and reuse of models for new downstream tasks of users.

[0005] Technical solution: A method for searching and reusing learning materials for image classification tasks, including:

[0006] 1) Obtaining models trained in a variety of different image classification tasks and corresponding training data sets, wherein the models are obtained after sufficient training on the training data sets;

[0007] 2) By using the corresponding trained model in the training data for prediction, the model prediction results and confidence levels are obtained and converted into text form;

[0008] 3) Use the image encoder of the text-image pre-training model to perform feature conversion on the training data to obtain image feature representation in a unified representation space, and use the text encoder to perform feature conversion on the model prediction results and the text obtained by confidence conversion to obtain text feature representation in a unified representation space;

[0009] 4) Using the Reduced Kernel Mean Embedding (RKME) technique, the image and text feature representations in the unified representation space obtained in step 3) are constructed into a model specification that describes the model function. These models cover different image classification tasks, so that users can search for the most suitable model from the learning library when facing new image classification tasks;

[0010] 5) forming a learning library by constructing specifications for a large number of image classification models, wherein the learning library contains a plurality of image classification models, each model having a specification capable of describing the function of the model;

[0011] 6) For the new image classification task, the user uses the image encoder of the text-image pre-trained model to perform feature conversion on the new task training data image to obtain image feature representation, and converts the real annotation corresponding to the image to obtain text feature representation, and uses step 4) to construct a specification for the new task;

[0012] 7) By calculating the maximum mean difference distance between the candidate model specifications in the learning library and the new task specifications, select the candidate model with the smallest distance to the new task specifications;

[0013] 8) Use the selected model to adapt and reuse in new tasks to achieve rapid response and efficient solution to new tasks.

[0014] In step 2), natural language is used to describe the model prediction results and confidence levels, thereby enabling a characterization of the model performance.

[0015] The step of using the selected model to adapt and reuse on the new task refers to using the matched model as the initial model, and then further training or adjusting it using its own data, thereby eliminating the need to collect a large amount of data and consume a lot of resources to train the data from scratch, thereby achieving rapid response and efficient solution to new tasks.

[0016] The obtaining of models and corresponding training data trained in a variety of different image classification tasks includes collecting representative image classification models and corresponding training data sets from multiple fields and application scenarios. These models should be fully trained on their training data sets.

[0017] The image encoder and text encoder of the text-image pre-training model can convert image and text data into feature vectors, which are located in a unified feature space, and serve as the basis for subsequent generation of model specifications. The text-image pre-training model is a multimodal pre-training model trained by a contrastive learning method using a large amount of image-text pair data, and includes an image encoder and a text encoder, which can convert image and text mappings into representations in a unified feature space, so as to facilitate more accurate specification generation and model search.

[0018] The abbreviated kernel mean embedding technique can accurately capture the relationship between model functions and data distribution, thereby generating a more accurate and comprehensive specification for each model. The step of using the abbreviated kernel mean embedding technique to integrate the training data distribution and performance of the model into a unified model specification involves using the abbreviated kernel mean embedding technique to effectively map the training data distribution and performance of the model, so that this information can be represented in a unified and information-rich specification, thereby enhancing the accuracy and efficiency of the model search and reuse process.

[0019] Users can use the above method to construct corresponding specifications according to the specific requirements of downstream tasks. Then, search the learning library for the machine learning model that best suits the task. This step enables users to quickly locate the model that best suits their specific needs, thereby improving the efficiency and accuracy of model reuse.

[0020] After selecting a model, users will use it to adapt and reuse downstream tasks. The key to this step is to effectively apply the capabilities of the selected model to new tasks to achieve the goals of rapid response and efficient problem solving.

[0021] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for searching and reusing learning documents for image classification tasks as described above is implemented.

[0022] A computer-readable storage medium stores a computer program for executing the method for searching and reusing learning documents for image classification tasks as described above.

[0023] The present invention provides a method for searching and reusing learning materials for image classification tasks. By generating and constructing a learning material library by reducing an image classification model, searching in the learning material library effectively improves the reuse performance of the model in different downstream tasks, and significantly optimizes the search and deployment process of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a method flow chart of an embodiment of the present invention;

[0025] Figure 2 It is a flow chart of the protocol structure proposed in the embodiment of the present invention. DETAILED DESCRIPTION

[0026] The present invention is further explained below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention. After reading the present invention, various equivalent forms of modifications to the present invention by those skilled in the art all fall within the scope defined by the claims attached to this application.

[0027] like Figure 1 As shown in the figure, the method of searching and reusing learning materials for image classification tasks mainly includes:

[0028] 101. Collect the trained image classification model;

[0029] Obtaining an image classification model and its corresponding training data includes collecting representative image classification models and corresponding training data sets from multiple fields and application scenarios. These models should be fully trained on their training data sets. In an embodiment of the present invention, the model can be any machine learning model for image classification tasks, and is not limited to the structure of the model and the training method used.

[0030] 102. Use the collected models to obtain the predicted categories and confidences on the respective training data and convert them into text form;

[0031] Assume that a certain model is f, and its corresponding training data set is Among them, x i is the image content, y i Image annotation. First, obtain the model for each training sample x i The predicted probability, q i =f(y|x i ). Then, we apply the argmax function to the probability distribution, producing a one-hot encoded predicted label Where max(q i ) can be seen as the model prediction x i For label After this, a new transformed dataset can be obtained This reflects the distribution of the training data and the function of the model. According to the text-image pre-training model, the model can be trained on each sample x i The prediction results and prediction confidence max(q i ) is converted into text t(x i ), for example, if the model predicts that a picture belongs to the "dog" category and the confidence is 0.9, you can get the text "a photo of a dog,confidence:0.9".

[0032] 103. Use the text-image pre-training model to project the images in the training data and the output of the model on the corresponding data into a unified feature space;

[0033] Given each training sample x i and its corresponding predicted text t(x i ), the data is projected into a unified space through the image encoder EI(·) and text encoder ET(·) in the text-image pre-training model to obtain unified features:

[0034]

[0035] 104. Use Reduced Kernel Mean Embedding (RKME) technology to construct the unified feature representation obtained in the above steps as a specification of the model;

[0036] Kernel Mean Embedding (KME) will be defined in The probability distribution on Mapped into an element of the Reproducing Hilbert Space (RKHS), it is represented as:

[0037]

[0038] in is a kernel function, assuming it is continuous, bounded, positive definite, and related to RHKS By using a kernel function, such as the Gaussian kernel function, the distribution In mapping to No information is lost after . In machine learning tasks, we can only access The sampled training data set Therefore, it is common practice to adopt the empirical approximation of KME:

[0039]

[0040] This can be The rate converges to the true KME.

[0041] The favorable properties of KME make it a potential specification for describing model functions. However, the reliance on the original training data may raise data privacy issues. To address this issue, we use a reduced set Get an approximate original training data set RKME of empirical KME, where m is the size of the abbreviated set, u is the sample in the abbreviated set, and β is the weight corresponding to each sample in the abbreviated set. Combined with the unified feature representation with training data distribution and model function information obtained in step 103 Generate an RKME specification for model f by minimizing the following objective

[0042]

[0043] The above minimization problem can be solved by the alternating optimization algorithm. The convergence rate of the empirical KME of RKME for the original training data set is

[0044] 105. Package each model and its corresponding protocol to build a learning library;

[0045] In this invention, it is assumed that the learning library has M available models where f m In the data set The feature space is trained on The label space is {1,…,K m}. N m ,d m and K m Represent the number of training samples, the dimension of feature space and the dimension of label space respectively. When the model developer submits the model to the learning library, a specification S is assigned to each model according to the steps described in 104. m .

[0046] 106. The user constructs a specification for the target task and then searches for the most suitable model in the learning library;

[0047] When users want to use the learning library To solve your own task, the target dataset for the new task is Its feature space is The label space is {1,…,K τ First, the new task image data and the corresponding data annotations are mapped to a unified representation space through the text-image pre-training model, and the corresponding abbreviated set is generated using the abbreviated kernel mean embedding technology as the user's specification S τ After receiving the user's specification, it compares the user's specification with the model specification in the learning library and returns a τ The model with the highest specification similarity.

[0048] 107. Use the searched model as the machine learning model for downstream tasks for further fine-tuning and reuse.

[0049] After receiving the model searched in the learning library, users can use fine-tuning or other model reuse methods to deploy the model on their own tasks.

[0050] Obviously, those skilled in the art should understand that the various steps of the method for searching and reusing learning documents for image classification tasks in the above-mentioned embodiment of the present invention can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.

Claims

1. A method for searching and reusing learning documents for image classification tasks, characterized in that: include: 1) Obtain models and corresponding training datasets trained in a variety of different image classification tasks; 2) By using the corresponding trained model in the training data for prediction, the model prediction results and confidence levels are obtained and converted into text form; 3) Use the image encoder of the text-image pre-training model to perform feature conversion on the training data to obtain image feature representation in a unified representation space, and use the text encoder to perform feature conversion on the model prediction results and the text obtained by confidence conversion to obtain text feature representation in a unified representation space; 4) Using the reduced kernel mean embedding technique, the image and text feature representations in the unified representation space obtained in step 3) are constructed as a model specification that describes the model function; 5) forming a learning library by constructing a specification for the image classification model, wherein the learning library includes a plurality of image classification models, each model having a specification capable of describing the function of the model; 6) For the new image classification task, the user uses the image encoder of the text-image pre-trained model to perform feature conversion on the new task training data to obtain image feature representation, and converts the real annotations corresponding to the data to obtain text feature representation, and uses step 4) to construct a specification for the new task; 7) By calculating the maximum mean difference distance between the candidate model specifications in the learning library and the new task specifications, select the candidate model with the smallest distance to the new task specifications; 8) Use the selected model for adaptation and reuse in new tasks.

2. The method for searching and reusing learning documents for image classification tasks according to claim 1, characterized in that: In step 2), natural language is used to describe the model prediction results and confidence levels, thereby enabling a characterization of the model performance.

3. The method for searching and reusing learning documents for image classification tasks according to claim 1, characterized in that: In the steps 2) to 3), the image encoder and text encoder of the text-image pre-training model are used to convert the training data and the model prediction results into image representation and text representation, and map them to a unified feature space; the text-image pre-training model is a multimodal pre-training model trained by a comparative learning method using image-text pair data, comprising an image encoder and a text encoder, which converts the image and text mapping into representations in a unified feature space to facilitate more accurate protocol generation and model search.

4. The method for searching and reusing learning documents for image classification tasks according to claim 1, characterized in that: The step of using the abbreviated kernel mean embedding technology in step 4) to integrate the training data distribution and performance of the model into a unified model specification; Combine unified features with information about training data distribution and model capabilities Generate an RKME specification for the submitted model f by minimizing the following objective Where m is the size of the abbreviated set, u is the sample in the abbreviated set, and β is the weight corresponding to each sample in the abbreviated set. The above minimization problem can be solved by the alternating optimization algorithm.

5. The method for searching and reusing learning documents for image classification tasks according to claim 1, characterized in that: The user uses the protocol construction method to construct a protocol description for the new image classification task, and then searches and reuses the most suitable machine learning model, including using local data to construct the protocol and matching it with the model protocol in the learning library to determine which models are most suitable for the current task. The matching process refers to calculating the similarity between the user's protocol and the protocol of each model in the learning library, and selecting one or more models with the highest similarity as the matching result.

6. The method for searching and reusing learning documents for image classification tasks according to claim 1, characterized in that: The step of using the selected model to adapt and reuse on a new task refers to using the matched model as the initial model and then further training or adjusting it using its own data.

7. A computer device, characterized in that: The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method for searching and reusing learning documents for image classification tasks as described in any one of claims 1 to 6 is implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the method for searching and reusing learning documents for image classification tasks as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Universal learning document searching and multiplexing method and device

    CN116542136A

  • Searching and multiplexing method for heterogeneous feature spatial learning elements

    CN116629374A

Cited By

  • Operation and maintenance learning piece model determination method, system and equipment, medium and product

    CN119128424A