Methods and systems for energy-based sample-model retrieval

WO2024187387A1PCT designated stage expired Publication Date: 2024-09-19HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/081467
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2024-09-19

Smart Images

  • Figure CN2023081467_19092024_PF_FP_ABST
    Figure CN2023081467_19092024_PF_FP_ABST
Patent Text Reader

Abstract

Methods and electronic devices for generating search results are disclosed. A method includes acquiring a set of data samples from the sample database, acquiring a set of pre-trained models from the model database, generating via an energy function an energy score for a given model from the set of pre-trained models using the set of data samples. The method includes ranking the set of pre-trained models using the energy score for the given model, thereby generating a ranked list of pre-trained models. The method includes generating the search results using the ranked list of pre-trained models, where the search results including the given model, and the given model is a highest-ranked model in the ranked list of pre-trained models. An other method includes a model-based sample search where a one or more data samples are acquired as search results for a given model using energy score calculation.
Need to check novelty before this filing date? Find Prior Art

Description

METHODS AND SYSTEMS FOR ENERGY-BASED SAMPLE-MODEL RETRIEVAL

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This is the first application related to the present technology described herein.FIELD

[0003] The present technology relates to sample-model retrieval, and more specifically to methods and systems for energy-based sample-model retrieval.BACKGROUND

[0004] Due to the wide applications of deep neural networks, an increasing number of pre-trained models are generated by training them on datasets from different sources. These pre-trained models can be employed to provide a good warm start for fine-tuning on target tasks, especially in transfer learning. Broadly, a “warm start” is an approach in machine learning that enables training or fine-tuning from a better initial point on the loss surface and potentially learn more performant models. Also, “transfer learning” refers to a machine learning method where a pre-trained model is re-used as the starting point for another model on a new task.

[0005] In some cases, there is a need to find a model that is most suitable for a given dataset. Given a target task (or dataset) and numerous machine learning models, the “model search” problem is defined as the procedure of finding, ranking, and selecting best models by evaluating all the given models for a target task (or dataset) . Model search can also be used for performing transferability assessment to predict fine-tuning results. The trivial solution to this problem is brute-force fine-tuning, where all the given pre-trained models need to be finetuned on the given dataset and then the best performing finetuned model is chosen for the target task. In other cases, there is a need to find data samples that are most suitable for a given model. Given an input model and a database of data samples, the “sample search” framework is used to search and find samples suitable for fine-tuning the given model.

[0006] Existing solutions to model search and sample search problems are time-consuming and computationally expensive. There is a need for ameliorating these techniques.

[0007] SUMMARY

[0008] Developers have devised methods and devices for overcoming at least some drawbacks present in prior art solutions.

[0009] It should be noted that searching and ranking pre-trained models is challenging because selection of an optimal pre-trained model is usually task-specific. Developers of the present technology have appreciated that conventional solutions to “model search” can be categorized into two types including: (i) heuristic methods, such as Log Expectation of the Empirical Predictor (LEEP) and Negative Conditional Entropy (NCE) , for example, and (ii) learning based methods, such as Logarithm of Maximum Evidence (LogME) , PacTran, and SFDA. In LEEP, the joint distribution of the pre-trained labels and the target labels is empirically computed over the given dataset to construct an empirical predictor. Then, a log expectation of the empirical predictor is used as a transferability measure. In NCE, conditional entropy is used between the label sequences of the source and target tasks to study the transferability between them. In LogME, evidence is defined as the marginalized likelihood, and then logarithm of maximum evidence is used to assess pre-trained models for transfer learning. In other words, LogME estimates the max value of label evidence based on the features extracted, and uses same to assess the models. In PacTran, PAC-Bayesian bounds is used to measure the transferability. PAC-Bayesian bounds measure the generalization gap using the cross-entropy loss. In SFDA, the static features obtained from a pre-trained models are transformed into the Fisher space and are then refined for better separability between classes. Then, it uses a self-challenging mechanism to encourage different pre-trained models to differentiate on hard examples.

[0010] Developers have realized at least some drawbacks of LEEP and NCE frameworks for solving the model search problem. LEEP and NCE methods require the entire dataset to be labeled, and cannot handle models trained in unsupervised settings. These solutions are limited to architecture type (only ResNet) , task (only image classification) , and also data type (only images) . Although they have low computational complexity, their performance in finding the relevant models can be ameliorated. Developers have realized at least some drawbacks of LogME, PacTran, and SFDA frameworks for solving the model search problem.  LogME, PacTran, and SFDA methods require training neural networks. This implies that LogME, PacTran, and SFDA methods need an entire training dataset to be labeled and suffer from high computational complexity.

[0011] It should be noted that some of the applications of the sample search include data valuation, pruning, and sample selection for unsupervised, self-supervised, and semi-supervised learning techniques. Developers of the present technology have appreciated conventional solutions for “sample search” problem such as, Variance of the pre-softmax activation Gradient (VOG) , GraNd, Complexity-Gap score (CG-score) , for example. In VoG, the variance of the pre-softmax activation gradient indexed at predicted / true label with respect to the input is used to determine difficulty of learning samples. In other words, the samples with high VoG scores are considered harder for the model to learn. In GraNd, the expected value of the loss gradient norm is used to score the importance of each training example. GraNd identifies a smaller set of training data that may enable generalization. CG-score is a training-free data valuation method which measures the impact of individual instances in optimization and generalization of neural networks.

[0012] Developers have realized at least some drawbacks of VoG framework for solving the sample search problem. VoG requires the entire training dataset to be labeled and requires a high complexity learning procedure. Furthermore, VoG can only be applied to a limited set of architectures, and performance thereof can be ameliorated. An other drawback is that VoG method cannot be used as a plug-and-play module for search engines. Developers have realized at least some drawbacks of the GraNd framework for solving the sample search problem. In addition to the drawbacks of the VoG, GraNd is limited to a certain type of tasks (i.e., classification) . Developers have realized at least some drawbacks with CG-score framework for solving the sample search problem. CG-methods require data labels for datasets and therefore cannot be used in unsupervised settings. In addition, CG-methods only work on certain architectures, tasks (only classification) , and data types (only images) . The other disadvantage of CG-score method is that it is not a plug-and-play solution which makes its integration with existing search frameworks challenging.

[0013] In the context of the present technology, there is provided methods and electronic devices for executing a “sample-based model” search. Broadly, the sample-based model search is a procedure with a goal of searching and finding models with the best performance, given one or more data samples. These data samples may have different types, such as  document (text) , image, audio, video, for example. In one example, given some dog images, the goal is to find top image classifiers with high classification accuracy on these images. As it will become apparent from the description herein further below, the data samples used for performing the sampled-based model search may be unlabelled data samples in some embodiments of the present technology.

[0014] In the context of the present technology, there is provided methods and electronic devices for performing a “model-based sample” search. Broadly, the model-based sample search is a procedure where, given a pre-trained model for some task, samples on which the given model has an acceptable performance are searched and identified. In some embodiments, the retrieved samples can then be used for fine-tuning the model’s performance. In one example, given a pre-trained model for dog identification, the goal is to find suitable unlabeled samples with high pseudo-labelling performance for semi-supervised learning.

[0015] As it will become apparent from the description herein further below, there is provided a search engine configured to performed at least one of (i) sample-based model search and (ii) model-based sample search using “energy scores” for ranking purposes of pre-trained models and / or of data samples. With reference to FIG. 6, there is depicted a comparison table between at least some prior art solutions and functionalities of methods and electronic devices as envisioned in at least non-limiting embodiments of the present technology.

[0016] In some embodiment, the search engine may be a high-performance energy-based solution for at least one of sample-based model search and model-based sample search. In other words, the search engine may comprise an energy-based decision-making module for finding the best matching models and / or samples.

[0017] In other embodiments, the search engine may be a dataset-free solution, meaning that acquisition of an entire training dataset of data samples is not necessarily required for performing model and / or sample search.

[0018] In additional embodiments, the search engine may be a training-free solution, meaning that the search engine can operate pre-trained models without the need for training / pre-training or fine-tuning those models. The entire model and sample search procedure can be performed at the inference phase of the respective models.

[0019] In further embodiments, the search engine may be a label-free solution, meaning that labels are not necessarily required for performing model and / or sample searches. The search engine may be configured to perform searches in a completely unsupervised manner.

[0020] In yet other embodiments, the search engine may be an architecture-agnostic solution, meaning that the search engine may be employed on a variety of models, irrespective of their respective neural architectures. For example, the search engine may be employed on ResNet models, DenseNet models, Transformed-based models, and the like. Broadly, a “neural network” may refer to systems of neurons that attempt to recognize underlying relationships in a set of data through a method that mimics the way the human brain works. Broadly, “ResNet” is an artificial neural network that introduced a so-called “identity shortcut connection, ” which allows the model to skip one or more layers. Broadly, “DenseNet” is a densely connected-convolutional network that takes all previous output as an input for a future layer. Broadly, a “Transformer” is a model that adopts the mechanism of self-attention and weights each part of the input data differentially. Computer vision and natural language processing are the two areas in which transformers are most widely used.

[0021] In yet additional embodiments, the search engine may be a task-agnostic and / or modality-agnostic solution, meaning that the search engine may be used (i) irrespective of specific machine learning tasks, such as classification, detection, generation, and the like, and / or (ii) irrespective of a specific data sample modality (type) such as images, video, audio, and text data, and the like.

[0022] In some embodiments, the search engine can be configured to operate on models that have been pre-trained with supervised and / or unsupervised methods. Broadly, “machine learning” refers to a type of artificial intelligence that makes it possible for software programs to become more accurate at making predictions without explicitly programming them to do so. The processes of machine learning are performed by taking historical data as input and predicting future outcomes. Broadly, a “pre-trained model” may refer to a model or a saved network trained on a large dataset to solve a problem. It undergoes a training procedure in which the algorithm uses historical data to extract patterns from them and learn to distinguish those patterns in unseen data. Broadly, a “dataset” may refer to a collection of data that is used to train the model. A dataset acts as an example to teach the machine learning algorithm how to make predictions. Broadly, “fine-tuning” may refer to adjusting a process in order to  get the intended output or performance. In deep learning, for example, the weights of a prior deep learning algorithm can be fine-tuned to design an other deep learning process.

[0023] In the context of the present technology, the search engine may be configured to execute an energy function on one or more data samples and one or more pre-trained models for generating energy scores for the purpose of ranking the one or more data samples and / or the one or more pre-trained models. Developers of the present technology have realized that using an energy function for performing ranking operations may be employed as a plug-&-play solution, meaning that the aspects it can be integrated with existing model search engines and / or sample search engines. It can also be said that energy score calculation used by the search can be parallelized over a batch of samples, without departing from the scope of the present technology.

[0024] In the context of the present technology, “object detection” may refer to a computer technology related to computer vision and image processing that deals with detecting instances of semantic objects of a certain class in digital images and / or videos. In the context of the present technology, a “downstream task” may refer to a fine-tuned task that inherited the model and parameters from a pre-trained model. In the context of the present technology, “transferability assessment” may refer to a procedure of assessing the transferability, i.e., an ability to acquire, transfer, and reuse knowledge of one model to an other model. In the context of the present technology, “generalization” may refer to a model's ability to adapt to new, previously unseen data, drawn from the same distribution as the one used to create the model. In the context of the present technology, “computer vision” may refer to a field of artificial intelligence (AI) enabling computers to derive information from images and videos. In the context of the present technology, “natural language processing” may refer an interdisciplinary subfield of linguistics, computer science, and artificial intelligence concerned with the interactions between computers and human language. In the context of the present technology, “data pruning” may refer to a process of removing sub-optimal tuples from a dataset to improve the learning of a machine learning model. In the context of the present technology, “supervised learning” may refer to a machine learning paradigm for problems where the available data consists of labelled examples, meaning that each data point contains features and an associated label. In the context of the present technology, “unsupervised learning” may refer to techniques employed by machine learning algorithms to analyze and cluster unlabeled datasets. In the context of the present technology, “self- supervised learning” may refer to a machine learning process where the model trains itself to learn one part of the input from another part of the input. In the context of the present technology, “semi-supervised learning” may refer to a learning problem that involves a small portion of labeled examples and a large number of unlabeled examples from which a model must learn and make predictions on new examples. In the context of the present technology, “image classification” may refer to categorization and labeling of different groups of images.

[0025] In the context of the present technology, “likelihood” can be used to find a best distribution of the data for some feature or some situation in the data given a certain value of some feature or situation. In other words, likelihood is an indicator of how likely an occurrence of an event is and which can be used to find the best matching models / samples. In the context of the present technology, a “density function” may refer to a tool used by machine learning for training purposes and which calculate probabilities from continuous random variables. In the context of the present technology, a “softmax function” may refer to a function that turns a vector of K real values into a vector of K real values that sum to 1. In the context of the present technology, a “confidence score” may refer to scores quantifying confidence of a machine learning model in its predictions. In the context of the present technology, a “softmax confidence score” may refer to a score calculated using the softmax function.

[0026] In a first broad aspect of the present technology, there is provide a method of generating search results. The method is executable by an electronic device. The electronic device is communicatively coupled to a sample database and a model database. The method comprises acquiring, by the electronic device, a set of data samples from the sample database. The method comprises acquiring, by the electronic device, a set of pre-trained models from the model database. The method comprises generating, by the electronic device using an energy function, an energy score for a given model from the set of pre-trained models using the set of data samples. The method comprises ranking, by the electronic device, the set of pre-trained models using the energy score for the given model, thereby generating a ranked list of pre-trained models. The method comprises generating, by the electronic device, the search results using the ranked list of pre-trained models, the search results including the given model, the given model being a highest-ranked model in the ranked list of pre-trained models.

[0027] In some embodiments of the method, the set of data samples includes at least one of a text sample, an image sample, an audio sample, and a video sample.

[0028] In some embodiments of the method, the set of data samples is a set of unlabelled data samples.

[0029] In some embodiments of the method, the set of pre-trained models includes at least one of a ResNet model, a DenseNet model, and a Transformer-based model.

[0030] In some embodiments of the method, the method further comprises fine-tuning, by the electronic device, the target model using the set of data samples.

[0031] In some embodiments of the method, the energy function is:

[0032] wherein fi is the given model, xj is a given data sample from the plurality of data samples, l is a real-valued logits for a pair (xj, fi) .

[0033] In some embodiments of the method, the energy score is:

[0034] wherein si is the energy score for the given model, X is the plurality of data samples, N is a number of data samples in the plurality of data samples.

[0035] In some embodiments of the method, the method further comprises: acquiring, by the electronic device, a textual query, and generating, by the electronic device, a text-based score for the given model using the textual query and textual information associated with the given model. The ranking comprises ranking, by the electronic device, the set of pre-trained models using the energy score and the text-based score.

[0036] In a second broad aspect of the present technology, there is provided a method of generating search results. The method is executable by an electronic device. The electronic device is communicatively coupled to a sample database and a model database. The method comprises acquiring, by the electronic device, a set of data samples from the sample database.  The method comprises acquiring, by the electronic device, a pre-trained model from the model database. The method comprises generating, by the electronic device using an energy function, an energy score for a given sample from the set of data samples using the pre-trained model. The method comprises ranking, by the electronic device, the set of data samples using the energy score for the given data sample, thereby generating a ranked list of data samples. The method comprises generating, by the electronic device, the search results using the ranked list of data samples, the search results including the given data sample, the given data sample being a highest-ranked data sample in the ranked list of data samples.

[0037] In some embodiments of the method, the set of data samples includes at least one of a text sample, an image sample, an audio sample, and a video sample.

[0038] In some embodiments of the method, the set of data samples is a set of unlabelled data samples.

[0039] In some embodiments of the method, the pre-trained model is at least one of a ResNet model, a DenseNet model, and a Transformer-based model.

[0040] In some embodiments of the method, the method further comprises fine-tuning, by the electronic device, the pre-trained model using the given data sample.

[0041] In some embodiments of the method, the energy function is:

[0042] wherein E (xj; fi) is the energy score for the given data sample xj , fi is the pre-trained model, l is a real-valued logits for a pair (xj, fi) .

[0043] In some embodiments of the method, the method further comprises acquiring, by the electronic device, a textual query and generating, by the electronic device, a text-based score for the given data sample using the textual query and textual information associated with the given data sample. The ranking comprises ranking, by the electronic device, the set of data samples using the energy score and the text-based score.

[0044] In a third broad aspect of the present technology, there is provided an electronic device for generating search results. The electronic device is communicatively coupled to a  sample database and a model database. The electronic device is configured to acquire a set of data samples from the sample database. The electronic device is configured to acquire a set of pre-trained models from the model database. The electronic device is configured to generate, using an energy function, an energy score for a given model from the set of pre-trained models using the set of data samples. The electronic device is configured to rank the set of pre-trained models using the energy score for the given model, thereby generating a ranked list of pre-trained models. The electronic device is configured to generate the search results using the ranked list of pre-trained models, the search results including the given model, the given model being a highest-ranked model in the ranked list of pre-trained models.

[0045] In some embodiments of the electronic device, the set of data samples includes at least one of a text sample, an image sample, an audio sample, and a video sample.

[0046] In some embodiments of the electronic device, the set of data samples is a set of unlabelled data samples.

[0047] In some embodiments of the electronic device, the set of pre-trained models includes at least one of a ResNet model, a DenseNet model, and a Transformer-based model.

[0048] In some embodiments of the electronic device, the method further comprises fine-tuning, by the electronic device, the target model using the set of data samples.

[0049] In some embodiments of the electronic device, the energy function is:

[0050] wherein fi is the given model, xj is a given data sample from the plurality of data samples, l is a real-valued logits for a pair (xj, fi) .

[0051] In some embodiments of the electronic device, the energy score is:

[0052] wherein si is the energy score for the given model, X is the plurality of data samples, N is a number of data samples in the plurality of data samples.

[0053] In some embodiments of the electronic device, the electronic device is further configured to acquire a textual query, and generate a text-based score for the given model using the textual query and textual information associated with the given model. The electronic device configured to rank comprises the electronic device configured to rank the set of pre-trained models using the energy score and the text-based score.

[0054] In a fourth broad aspect of the present technology, there is provided an electronic device for generating search results. The electronic device is communicatively coupled to a sample database and a model database. The electronic device is configured to acquire a set of data samples from the sample database. The electronic device is configured to acquire a pre-trained model from the model database. The electronic device is configured to generate, using an energy function, an energy score for a given sample from the set of data samples using the pre-trained model. The electronic device is configured to rank the set of data samples using the energy score for the given data sample, thereby generating a ranked list of data samples. The electronic device is configured to generate the search results using the ranked list of data samples, the search results including the given data sample, the given data sample being a highest-ranked data sample in the ranked list of data samples.

[0055] In some embodiments of the electronic device, the set of data samples includes at least one of a text sample, an image sample, an audio sample, and a video sample.

[0056] In some embodiments of the electronic device, the set of data samples is a set of unlabelled data samples.

[0057] In some embodiments of the electronic device, the pre-trained model is at least one of a ResNet model, a DenseNet model, and a Transformer-based model.

[0058] In some embodiments of the electronic device, the method further comprises fine-tuning, by the electronic device, the pre-trained model using the given data sample.

[0059] In some embodiments of the electronic device, the energy function is:

[0060] wherein E (xj; fi) is the energy score for the given data sample xj , fi is the pre-trained model, l is a real-valued logits for a pair (xj, fi) .

[0061] In some embodiments of the electronic device, the electronic device is further configured to acquire a textual query, and generate a text-based score for the given data sample using the textual query and textual information associated with the given data sample. The electornic device configured to rank comprises the electronic device configured to rank the set of data samples using the energy score and the text-based score.

[0062] In the context of the present specification, a “server” is a computer program that is running on appropriate hardware and is capable of receiving requests (e.g., from devices) over a network, and carrying out those requests, or causing those requests to be carried out. The hardware may be one physical computer or one physical computer system, but neither is required to be the case with respect to the present technology. In the present context, the use of the expression a “server” is not intended to mean that every task (e.g., received instructions or requests) or any particular task will have been received, carried out, or caused to be carried out, by the same server (i.e., the same software and / or hardware) ; it is intended to mean that any number of software elements or hardware devices may be involved in receiving / sending, carrying out or causing to be carried out any task or request, or the consequences of any task or request; and all of this software and hardware may be one server or multiple servers, both of which are included within the expression “at least one server” .

[0063] In the context of the present specification, “device” is any computer hardware that is capable of running software appropriate to the relevant task at hand. Thus, some (non-limiting) examples of devices include personal computers (desktops, laptops, netbooks, etc. ) , smartphones, and tablets, as well as network equipment such as routers, switches, and gateways. It should be noted that a device acting as a device in the present context is not precluded from acting as a server to other devices. The use of the expression “a device” does not preclude multiple devices being used in receiving / sending, carrying out or causing to be carried out any task or request, or the consequences of any task or request, or steps of any method described herein.

[0064] In the context of the present specification, a “database” is any structured collection of data, irrespective of its particular structure, the database management software, or the computer hardware on which the data is stored, implemented or otherwise rendered available for use. A database may reside on the same hardware as the process that stores or makes use of the information stored in the database or it may reside on separate hardware, such as a  dedicated server or plurality of servers. It can be said that a database is a logically ordered collection of structured data kept electronically in a computer system

[0065] In the context of the present specification, the expression “information” includes information of any nature or kind whatsoever capable of being stored in a database. Thus information includes, but is not limited to audiovisual works (images, movies, sound records, presentations etc. ) , data (location data, numerical data, etc. ) , text (opinions, comments, questions, messages, etc. ) , documents, spreadsheets, lists of words, etc.

[0066] In the context of the present specification, the expression “component” is meant to include software (appropriate to a particular hardware context) that is both necessary and sufficient to achieve the specific function (s) being referenced.

[0067] In the context of the present specification, the expression “computer usable information storage medium” is intended to include media of any nature and kind whatsoever, including RAM, ROM, disks (CD-ROMs, DVDs, floppy disks, hard drivers, etc. ) , USB keys, solid state-drives, tape drives, etc.

[0068] In the context of the present specification, the words “first” , “second” , “third” , etc. have been used as adjectives only for the purpose of allowing for distinction between the nouns that they modify from one another, and not for the purpose of describing any particular relationship between those nouns. Thus, for example, it should be understood that, the use of the terms “first server” and “third server” is not intended to imply any particular order, type, chronology, hierarchy or ranking (for example) of / between the server, nor is their use (by itself) intended imply that any “second server” must necessarily exist in any given situation. Further, as is discussed herein in other contexts, reference to a “first” element and a “second” element does not preclude the two elements from being the same actual real-world element. Thus, for example, in some instances, a “first” server and a “second” server may be the same software and / or hardware, in other cases they may be different software and / or hardware.

[0069] Implementations of the present technology each have at least one of the above-mentioned object and / or aspects, but do not necessarily have all of them. It should be understood that some aspects of the present technology that have resulted from attempting to attain the above-mentioned object may not satisfy this object and / or may satisfy other objects not specifically recited herein.

[0070] Additional and / or alternative features, aspects and advantages of implementations of the present technology will become apparent from the following description, the accompanying drawings and the appended claims.BRIEF DESCRIPTION OF THE DRAWINGS

[0071] For a better understanding of the present technology, as well as other aspects and further features thereof, reference is made to the following description which is to be used in conjunction with the accompanying drawings, where:

[0072] FIG. 1 illustrates an example of a computing device that may be used to implement any of the methods described herein

[0073] FIG. 2 depicts a system executing a sample-based model search in accordance with some non-limiting embodiments of the present technology;

[0074] FIG. 3 depicts the system executing a model-based sample search in accordance with some non-limiting embodiments of the present technology;

[0075] FIG. 4 is a detailed representation of the sample-based model search executed by the system of FIG. 1A using energy scores, in accordance with some non-limiting embodiments of the present technology;

[0076] FIG. 5 is a detailed representation of the model-based sample search executed by the system of FIG. 1A using energy scores, in accordance with some non-limiting embodiments of the present technology;

[0077] FIG. 6 depicts a comparison table between at least some prior art solutions and functionalities of the system in accordance with at least some non-limiting embodiments of the present technology;

[0078] FIG. 7A depicts an other system executing sample-based model verification in accordance with at least some non-limiting embodiments of the present technology.

[0079] FIG. 7B depicts an additional system executing sample-based model clone detection in accordance with at least some non-limiting embodiments of the present technology

[0080] FIG. 8 is a scheme-block illustration of a method of generating search results in accordance with at least some non-limiting embodiments of the present technology.

[0081] FIG. 9 is a scheme-block illustration of an other method of generating search results in accordance with at least some non-limiting embodiments of the present technology.DETAILED DESCRIPTION

[0082] The examples and conditional language recited herein are principally intended to aid the reader in understanding the principles of the present technology and not to limit its scope to such specifically recited examples and conditions. It will be appreciated that those skilled in the art may devise various arrangements which, although not explicitly described or shown herein, nonetheless embody the principles of the present technology and are included within its spirit and scope.

[0083] Furthermore, as an aid to understanding, the following description may describe relatively simplified implementations of the present technology. As persons skilled in the art would understand, various implementations of the present technology may be of a greater complexity.

[0084] In some cases, what are believed to be helpful examples of modifications to the present technology may also be set forth. This is done merely as an aid to understanding, and, again, not to define the scope or set forth the bounds of the present technology. These modifications are not an exhaustive list, and a person skilled in the art may make other modifications while nonetheless remaining within the scope of the present technology. Further, where no examples of modifications have been set forth, it should not be interpreted that no modifications are possible and / or that what is described is the sole manner of implementing that element of the present technology.

[0085] Moreover, all statements herein reciting principles, aspects, and implementations of the present technology, as well as specific examples thereof, are intended to encompass both structural and functional equivalents thereof, whether they are currently known or developed in the future. Thus, for example, it will be appreciated by those skilled in the art that any block diagrams herein represent conceptual views of illustrative circuitry embodying the principles of the present technology. Similarly, it will be appreciated that any flowcharts, flow diagrams, state transition diagrams, pseudo-code, and the like represent various  processes which may be substantially represented in computer-readable media and so executed by a computer or processor, whether or not such computer or processor is explicitly shown.

[0086] The functions of the various elements shown in the figures, including any functional block labeled as a "processor" , may be provided through the use of dedicated hardware as well as hardware capable of executing software in association with appropriate software. When provided by a processor, the functions may be provided by a single dedicated processor, by a single shared processor, or by a plurality of individual processors, some of which may be shared. In some embodiments of the present technology, the processor may be a general purpose processor, such as a central processing unit (CPU) or a processor dedicated to a specific purpose, such as a digital signal processor (DSP) . Moreover, explicit use of the term a "processor" should not be construed to refer exclusively to hardware capable of executing software, and may implicitly include, without limitation, application specific integrated circuit (ASIC) , field programmable gate array (FPGA) , read-only memory (ROM) for storing software, random access memory (RAM) , and non-volatile storage. Other hardware, conventional and / or custom, may also be included.

[0087] Software modules, or simply modules which are implied to be software, may be represented herein as any combination of flowchart elements or other elements indicating performance of process steps and / or textual description. Such modules may be executed by hardware that is expressly or implicitly shown. Moreover, it should be understood that module may include for example, but without being limitative, computer program logic, computer program instructions, software, stack, firmware, hardware circuitry or a combination thereof which provides the required capabilities.

[0088] With these fundamentals in place, we will now consider some non-limiting examples to illustrate various implementations of aspects of the present technology.

[0089] FIG. 1 illustrates a diagram of a computing environment 100 in accordance with an embodiment of the present technology is shown. In some embodiments, the computing environment 100 may be implemented by any of a conventional personal computer, a computer dedicated to operating and / or monitoring systems relating to a data center, a controller and / or an electronic device (such as, but not limited to, a mobile device, a tablet device, a server, a controller unit, a control device, a monitoring device etc. ) and / or any  combination thereof appropriate to the relevant task at hand. In some embodiments, the computing environment 100 comprises various hardware components including one or more single or multi-core processors collectively represented by a processor 110, a solid-state drive 120, a random access memory 130 and an input / output interface 150.

[0090] In some embodiments, the computing environment 100 may also be a sub-system of one of the above-listed systems. In some other embodiments, the computing environment 100 may be an “off the shelf” generic computer system. In some embodiments, the computing environment 100 may also be distributed amongst multiple systems. The computing environment 100 may also be specifically dedicated to the implementation of the present technology. As a person in the art of the present technology may appreciate, multiple variations as to how the computing environment 100 is implemented may be envisioned without departing from the scope of the present technology.

[0091] Communication between the various components of the computing environment 100 may be enabled by one or more internal and / or external buses 160 (e.g. a PCI bus, universal serial bus, IEEE 1394 “Firewire” bus, SCSI bus, Serial-ATA bus, ARINC bus, etc. ) , to which the various hardware components are electronically coupled.

[0092] The input / output interface 150 may allow enabling networking capabilities such as wire or wireless access. As an example, the input / output interface 150 may comprise a networking interface such as, but not limited to, a network port, a network socket, a network interface controller and the like. Multiple examples of how the networking interface may be implemented will become apparent to the person skilled in the art of the present technology. For example, but without being limitative, the networking interface may implement specific physical layer and data link layer standard such as Ethernet, Fibre Channel, Wi-Fi or Token Ring. The specific physical layer and the data link layer may provide a base for a full network protocol stack, allowing communication among small groups of computers on the same local area network (LAN) and large-scale network communications through routable protocols, such as Internet Protocol (IP) .

[0093] According to implementations of the present technology, the solid-state drive 120 stores program instructions suitable for being loaded into the random access memory 130 and executed by the processor 110 for executing operating data centers based on a generated  machine learning pipeline. For example, the program instructions may be part of a library or an application.

[0094] With reference to FIG. 2, there is depicted a system 200 as envisioned in at least some embodiments of the present technology. The system 200 comprises an electronic device 201 configured to execute a Sample-Model Retrieval (SAMOR) search engine 202. In some embodiments, the electronic device 201 may be implemented in a similar manner to how the computing environment 100 is implemented. It is contemplated that the SAMOR search engine 202 may be configured to perform inter alia a sample-based model search.

[0095] The system 200 also comprises an electronic device 203 communicatively coupled with the electronic device 201. The electronic device 205 is configured to store a dataset 204. In this example, the dataset 204 comprises images, but this might not be the case in other embodiments of the present technology. In some embodiments of the present technology, the electronic device 203 may be implemented as a repository storing the dataset 204. In other embodiments, the electronic device 203 may be implemented in a similar manner to how the computing environment 100 is implemented and associated with an end user. In further embodiments, it is contemplated that the dataset 204 may be stored by a same electronic device as the electronic device configured to execute the SAMOR search engine 202, without departing from the scope of the present technology.

[0096] In some embodiments, the electronic device 201 may be communicatively coupled to the electronic device 203 via a communication network (not depicted) . In some non-limiting embodiments of the present technology, the communication network can be implemented as the Internet. In other non-limiting embodiments of the present technology, the communication network can be implemented differently, such as any wide-area communication network, local-area communication network, a private communication network and the like. Merely as an example and not as a limitation, a communication link between the electronic device 201 and the electronic device 203 can be implemented as a wireless communication link (such as but not limited to, a 3G communication network link, a 4G communication network link, Wireless Fidelity, or  for short,  and the like) . In other examples, the communication link can be either wireless (such as Wireless Fidelity, or  for short,  or the like) or wired (such as an Ethernet based connection) .

[0097] The system 200 also comprises an electronic device 205 communicatively coupled with the electronic device 201. The electronic device 205 is configured to store a model database 206. The model database 206 comprises a plurality of Machine Learning (ML) models 207. In some embodiments of the present technology, the electronic device 205 may be implemented as a repository storing the model database 206. In other embodiments, the electronic device 205 may be implemented in a similar manner to how the computing environment 100 is implemented. In further embodiments, it is contemplated that the model database 206 may be hosted on a same electronic device as the electronic device 201 configured to execute the SAMOR search engine 202. In some embodiments, the electronic device 205 may be communicatively coupled to the client device 201 via the communication network.

[0098] The SAMOR engine 202 is configured to acquire an input from the dataset 204. The dataset 204 may be configured to store one or more data samples providable as input to the SAMOR engine 202. In some embodiments, the data samples from the dataset 204 may be labelled data samples. In other embodiments, the dataset 204 may include unlabeled data samples. As it will become apparent from the description herein further below, the SAMOR engine 202 may be configured to perform a sample-based model search using unlabeled data. In one example, data samples stored in the dataset 203 may comprise image data samples. However, the type of data samples stored in the dataset 204 is not particularly limiting. It can be said that the SAMOR engine 202 may be a modality-agnostic search engine, meaning that it can perform search using various data samples irrespective of their specific type. It can also be said that the SAMOR engine 202 may be a label-free search engine, meaning that it can perform search using unlabeled data samples.

[0099] The SAMOR engine 202 is configured to make use of the model database 206 for performing the sample-based model search. Broadly speaking, the model database 206 is a collection of pre-trained ML models including the plurality of ML models 207. The SAMOR engine 202 is configured to acquire the input including one or more data samples, perform a search over the model database 206, and identify one or more ML models from the plurality of ML models 207 as top search results. It is contemplated that search results may be embodied as a ranked list of pre-trained models in accordance with respective ranking scores. How the ranking scores are determined by the SAMOR engine 202 will be discussed in greater details herein further below.

[0100] In the example illustrated in FIG. 2, the top search results comprise a first model 208 and a second model 210. In one implementation, the first model 208 may be a MobileNetV3 architecture pre-trained for dog image classification. Broadly, MobileNetV3 is a deep neural network that is optimized to run on mobile phone CPUs. MobileNetV3 is capable of performing image classification, object detection and semantic segmentation. In an other implementation, the second model 210 may be a Yolov5 architecture pre-trained for “cat” and “dog” object detection. Broadly, Yolov5 is a deep neural network that performs real-time object detection. Multiple versions of Yolov5 with different trade-offs (e.g., accuracy-speed) are known.

[0101] Optionally, the SAMOR engine 202 may be configured to make use of a textual query 212 in addition to the input data samples from the dataset 204. As it will become apparent from the description herein further below, the textual query 212 may be used to determining a text-based ranking score, which can be used in combination with other types of ranking scores for generating combined ranking scores for respective pre-trained models.

[0102] Additionally or alternatively, the system 200 may be employed to fine-tune one or more models (such as the first model 208 and / or the second model 210, for example) using inputted samples from the dataset 204. It is contemplated that the first model 208 may be further trained by the electronic device 203 and / or the electronic device 201 to perform dog image classification using data samples from the dataset 204. It is contemplated that the second model 210 may be further trained by the electronic device 203 and / or the electronic device 201 to perform “cat” and “dog” object detection using data samples from the dataset 204.

[0103] In some embodiments, the SAMOR engine 202 may be configured to receive a query in a form of one or more data samples from the dataset 204 (and optionally the text query 212) , such as documents, images, audio, video, for example. The SAMOR engine 202 may be configured to search and identify pre-trained models from the plurality of models 207 that have comparatively better performance over the provided data samples than other ones from the plurality of models 207. For example, given input data samples in the form of dog images, the SAMOR engine 202 may be configured to search and identify top image classifiers with high classification accuracy on the dog images.

[0104] With reference to FIG. 3, there is depicted a system 300 as envisioned in at least some embodiments of the present technology. The system 300 comprises an electronic device 301 configured to execute a SAMOR search engine 302. In some embodiments, the electronic device 301 may be implemented in a similar manner to how the computing environment 100 and / or the electronic device 201 is implemented. Broadly, the SAMOR search engine 202 is configured to perform inter alia a model-based sample search.

[0105] The system 300 also comprises an electronic device 303 communicatively coupled with the electronic device 301. The electronic device 303 is configured to store a third model 308. In one implementation, the third model 308 may have Yolov5 architecture and pre-trained for dog detection. In other embodiments, the electronic device 303 may be implemented in a similar manner to how the computing environment 100 and / or the electronic device 203 is implemented and associated with an end user. In some embodiments, the electronic device 301 may be communicatively coupled to the electronic device 303 via a communication network (not depicted) . In further embodiments, it is contemplated that the third model 308 may be stored by a same electronic device as the electronic device configured to execute the SAMOR search engine 302, without departing from the scope of the present technology.

[0106] The system 300 also comprises an electronic device 305 communicatively coupled with the electronic device 301. In some embodiments, the electronic device 205 may be implemented in a similar manner to how the computing environment 100 is implemented. The electronic device 305 is configured to store a samples database 306. The samples database 306 comprises a plurality of data samples 307. In some embodiments, at least some of the plurality of data samples 307 may be labeled and stored in association with respective labels. In other embodiments, at least some of the plurality of data samples 307 may be unlabeled data samples. It is contemplated that the samples database 306 may be hosted on a same electronic device as the electronic device 201 configured to execute the SAMOR search engine 302. In some embodiments, the electronic device 305 may be communicatively coupled to the client device 301 via the communication network.

[0107] The SAMOR engine 302 is configured to acquire an input in a form of a pre-trained ML model. For example, the SAMOR engine 302 may acquire from the electronic device 303 the third model 308. Optionally, the SAMOR engine 302 may further acquire a textual query 312 as input. The SAMOR engine 302 is configured to process inputs and search the samples  database 306 to identify search results in a form of a ranked list of data samples. To that end, the SAMOR engine 302 is configured to generate, based on inputs and the third model 308, ranking scores for respective data samples in the samples database 306. How that ranking scores are determined by the SAMOR engine 302 will be discussed in greater details herein further below.

[0108] Additionally or alternatively, the electronic device 303 may acquire one or more search results provided by the SAMOR engine 302 and fine-tune the third model 308 based on the data samples corresponding to the one or more search results. In those embodiments where the data samples acquired by the electronic device 303 from the SAMOR engine 302 are unlabeled data samples, pseudo-labels may be generated for the respective unlabeled data samples. The pseudo-labels may be generated using the third model 308.

[0109] In some embodiments, it can be said that the SAMOR engine 302 may be configured to receive a query in a form of a pre-trained model (and potentially a textual query) , and search and identify data samples from the plurality of data samples 307 on which the third model 308 has a comparatively better performance than on other ones from the plurality of data samples 307. The identified data samples may be used by the electronic device 303 to further train the third model 308 to increase its performance in a given task. For example, given a pre-trained model for dog identification, the SAMOR engine 308 may be used to identify unlabeled data samples with highest pseudo-labelling performance for semi-supervised learning.

[0110] With reference to FIG. 4, there is depicted a schematic representation of how ranking scores (e.g., energy scores 410) may be generated for pre-trained models by the SAMOR engine 202 in FIG. 2. As it will become apparent from the description herein further below, the SAMOR engine 202 may be configured to perform sample-based model search using the energy scores 410 for ranking pre-trained models.

[0111] For example, an end user 402 may employ the electronic device 203 to provide input data samples 204 to the SAMOR engine 202. In one implementation, the end user 402 can be associated with a traffic management office of a city that captures data using the cameras and employs the SAMOR engine 202 to improve a car detection model using the captured data. In an other implementation, the end user 402 can be associated with a farm and captures images of the farm and employs the SAMOR engine 202 to find a semantic segmentation model to  perform segmentation automatically. Let X: {x0, x1, ..., xN} be the input data samples 204 and F: {f0, f1, ..., fM} be the plurality of pre-trained models 207 from the model database 206. In this example, the SAMOR engine 202 is configured to process and rank models from the plurality of models 207, and thereby output a list of ranked models 414, denoted by F*, that are ranked high-to-low based on their corresponding energy scores from the plurality of energy scores 410. It is contemplated that the SAMOR engine 202 may configured to rank only some of the models from the plurality of model 207, without departing from the scope of the present technology.

[0112] In some embodiments of the present technology, the SAMOR engine 202 may be configured to perform sample-based model search in accordance to Algorithm (1) .

[0113] It can be said that the SAMOR engine 202 is configured to find the models that in a sense are “suitable” for the input data samples 404 –i.e., models for which the input samples have high likelihood in their respective density probability functions. It can be shown that a data point with a higher probability of occurrence is equivalent to having higher energy. Developers of the present technology have realized that, since a given energy score has a linear alignment with the log likelihood function, energy scores are a well-suited for determining which models are most suitable for a given set of input data samples. It can be said that linear alignment refers to a linear relation between the log likelihood and the energy. It should be noted that higher energy scores are indicative of a higher likelihood of a given data point and represent more suitable models for the input data samples. Developers of the present technology have also realized that, since an energy function 408 is aligned with the probability density of the input data samples 204, the energy scores 410 are comparatively less affected by the overconfidence issue that exists in the other types of scores, such as softmax confidence scores, for example.

[0114] In order to calculate a given energy score for each pre-trained model fi, each data sample xj is fed to fi. For this, the pair of (fi, xj) is sent to the energy function 408 denoted as E (.) and executable by the SAMOR engine 202. The procedure of energy score calculation can be implemented by the SAMOR engine 202 in accordance with a following Algorithm (2) .

[0115] As seen, the real-valued logits (denoted by L) computed by a given model (after receiving the data sample as input) are obtained. The energy score corresponding to the (fi, xj) pair is then calculated in accordance with equation (1) :

[0116] E (xj; fi) = log∑l∈Lel , where L=fi (xj)           (1)

[0117] Having all the energy scores corresponding to each data sample xj (N samples in total) , the overall energy score for model fi can computed be computed by the SAMOR engine 202 in accordance with equation (2) :

[0118] Having the list of all energy scores all the models F are accordingly ranked by the SAMOR engine 202 from the highest to lowest overall energy score: F*=Rank (F; S) . The ranked list of models F* (or at least a highest ranked model) is then returned to the end use.

[0119] In summary, the SAMOR engine 202 is configured to input the input samples 204 into the plurality of pre-trained models 207, and apply the energy function 408 on respective sample-model pairs. Scores generated by the energy function 408 may used by the SAMOR engine 202 for generating the respective energy scores 410. The SAMOR engine 202 is then configured to perform model ranking procedure 412 for generating the ranked list 414 in which a top pre-trained model 416 is associated with a highest energy score from the energy  scores 410, and a bottom pre-trained model 418 is associated with a lowest energy score from the energy scores 410.

[0120] As previously alluded to, the SAMOR engine 202 may be configured to employ textual inputs for providing a text-based sample-model retrieval framework. It is contemplated that the SAMOR engine 302 may be configured to receive text-based and sample-based queries as the input. The SAMOR engine 302 may be configured to perform a text-based search over textual descriptions associated with respective pre-trained models in the model database 206. For example, textual descriptions may include model card information. This information may be stored in the model database 206 in association with respective ones from the plurality of pre-trained models 207. The text-based search results can then be combined with the sample-based search results (e.g., average over their scores) to provide the search results. In some embodiments, text-based ranking scores may be generated based on a comparison between the textual descriptions and the textual input using known techniques. Such text-based scores may be then employed by the SAMOR engine 202 in combination with energy scores for generating combined ranking scores for respective models form the plurality of models 207.

[0121] With reference to FIG. 5, there is depicted a schematic representation of how ranking scores may be generated for data samples by the SAMOR engine 302 in FIG. 3. As it will become apparent from the description herein further below, the SAMOR engine 302 may be configured to perform model-based sample search using energy scores 510 for ranking data samples. In some embodiments of the present technology, the SAMOR engine 302 may be configured to perform model-based sample search in accordance to Algorithm (3) .

[0122] For example, an end user 502 may provide a pre-trained model 308 as input to the SAMOR engine 302. The SAMOR engine 302 is configured to execute an energy function 408 for generating the energy scores 510 for respective ones from a plurality of data samples 307. For example, let f be the input pre-trained model 308 and X: {x0, x1, ..., xN} be the  plurality of data samples 307 acquired from the database 306. In this example, the SAMOR engine 302 is configured to process and rank the plurality of data samples 307 and output a list of ranked samples 514, denoted by X*, that are ranked high-to-low based on their corresponding energy scores from the plurality of energy scores 510.

[0123] In some embodiments, the SAMOR engine 302 may be configured to determine which samples from the plurality of data samples yield a high likelihood in the density probability function of the pre-trained model 308. Developers of the present technology have realised that, since energy scores have a linear alignment (linear relationship) with the log likelihood function, it is a well-suited for determining which samples are most suitable for a given pre-trained model. It should be noted that higher energy scores are indicative of higher likelihood and represent more suitable samples for the input pre-trained model. In addition, developers of the present technology have also realized that, since the energy function is aligned (linear relationship) with the probability density of the input, energy scores are comparatively less affected by the overconfidence issue that exist with other types of scores, such as softmax confidence score, for example.

[0124] In order to compute energy scores for each data sample xj, each data sample is fed to the input pre-trained model f. For this, the pair of (xj; f) is sent to the energy function 408 E (.) . The procedure of energy score calculation can be implemented by the SAMOR engine 302 similarly to how the energy score calculation algorithm shown in Algorithm 2 above. It should be noted that the SAMOR engine 302 may be configured to compute the real-valued logits by feeding the data sample into the pre-trained model 308. An energy score corresponding to the (xj; f) pair can be computed by the SAMOR engine 302 using the equation (1) .

[0125] Having the list of all energy scores,  all the samples X can be ranked by the SAMOR engine 302, from the highest to lowest overall energy score: X*=Rank (X; S) , for example. The ranked list of data samples X* (or at least the top ranked data sample) can be provided as search results to the end user.

[0126] In summary, the SAMOR engine 302 is configured to input the data samples 307 into the pre-trained model 308, and apply the energy function 408 on respective sample-model pairs. Scores generated by the energy function 408 may used by the SAMOR engine 302 for  generating the respective energy scores 510. The SAMOR engine 302 is then configured to perform sample ranking procedure 512 for generating the ranked list 514 in which a top sample 516 is associated with a highest energy score from the energy scores 510, and a bottom sample 518 is associated with a lowest energy score from the energy scores 510.

[0127] As previously alluded to, the SAMOR engine 302 may be configured to further acquire textual inputs to provide a text-based sample-model retrieval framework. In some embodiments, both text-based and model-based queries can be acquired by the SAMOR engine 302 as the input. The SAMOR engine 302 may be configured to perform a text-based search on textual descriptions / captions / tags of data samples. Textual information about data samples can be stored in the sampled database 306 in association with the respective ones form the plurality of data samples 307. The text-based search results can then be combined with the sample-based search results (e.g., average over their scores) to provide the final search results. In some embodiments, text-based ranking scores may be generated based on a comparison between the textual descriptions and the textual input using known techniques. Such text-based scores may be then employed by the SAMOR engine 302 in combination with energy scores for generating combined ranking scores for respective data samples form the plurality of models 307.

[0128] With reference to FIG. 7A, there is depicted another embodiment of the present technology. A system 700 comprises an SAMOR engine 702 for executing sample-based model verification. Sample-based model verification can be used to verify if a model 706 can handle given input samples 704 (e.g., providing accurate predictions on the samples) . The energy score corresponding to the model 706 on the given input samples 704 is calculated first. If the energy score is greater than a pre-determined threshold (e.g., provided by an operator) , good performance of the model 706 over the samples 704 is considered as “verified” , thereby generating a positive indication 710.

[0129] With reference to FIG. 7B, there is depicted a further embodiment of the present technology. A system 750 comprises an SAMOR engine 752 executing sample-based model clone detection. Sample-based model clone detection can be used to check if two models 756 and 758 have similar performance on given samples 754. The energy score for each of the two model 756 and 758 is first calculated (via equation 1 for example) . If the energy scores for both of the models 756 and 758 are equal (or within a pre-determined acceptable interval) ,  the models 756 and 758 are considered as clones (similar performance on the same set of samples) .

[0130] With reference to FIG. 8, there is depicted a scheme-block representation of a method 800 executable by the computing environment 100 in accordance with at least some non-limiting embodiments of the present technology. Various steps of the method 800 will now be discussed in greater details.

[0131] STEP 802: acquiring, by the electronic device, a set of data samples from the sample database

[0132] At step 802, the electronic device 201 is configured to acquire the set of data samples 204. In some embodiments, the set of data samples 204 includes at least one of a text sample, an image sample, an audio sample, and a video sample. In other embodiments, the set of data samples 204 may be a set of unlabelled data samples.

[0133] STEP 804: acquiring, by the electronic device, a set of pre-trained models from the model database

[0134] At step 804, the electronic device 201 is configured to acquire the set of pre-trained models 207 from the model database 206. In some embodiments the set of pre-trained models 207 includes at least one of a ResNet model, a DenseNet model, and a Transformer-based model.

[0135] STEP 806: generating, by the electronic device using an energy function, an energy score for a given model from the set of pre-trained models using the set of data samples

[0136] At step 806, the electronic device 201 is configured to generate an energy score using the energy function 408 for a given model from the set of pre-trained models 207 using the set of data samples 204. For example, the electronic device 201 may be configured to generate the energy score s1 using the equations 1 and 2.

[0137] It is contemplated that the energy score for a given model may be an average of scores computed for respective pairs of the given model and a given sample from the set of data samples 204.

[0138] STEP 808: ranking, by the electronic device, the set of pre-trained models using the energy score for the given model, thereby generating a ranked list of pre-trained models

[0139] At step 808, the electronic device 201 is configured to rank the set of pre-trained models 207 using the energy score of the given model, and thereby generate the ranked list of pre-trained models 414. It is contemplated that the electronic device 201 may generate energy scores for respective models, and rank those models using their respective energy scores.

[0140] STEP 810: generating, by the electronic device, the search results using the ranked list of pre-trained models, the search results including the given model, the given model being a highest-ranked model in the ranked list of pre-trained models

[0141] At step 810, the electronic device 201 is configured to generate search results using the ranked list of pre-trained models 414. The search results include the given model. The given model is a highest-ranked model in the ranked list of pre-trained models 414. It should be noted that the search results may include top N models from the ranked list of pre-trained models 414, without departing from the scope of the present technology.

[0142] With reference to FIG. 9, there is depicted a scheme-block representation of a method 900 executable by the computing environment 100 in accordance with at least some non- limiting embodiments of the present technology. Various steps of the method 900 will now be discussed in greater details.

[0143] STEP 902: acquiring, by the electronic device, a set of data samples from the sample database

[0144] At step 902, the electronic device 301 is configured to acquire a set of data samples 307. In some embodiments, the set of data samples 307 includes at least one of a text sample, an image sample, an audio sample, and a video sample. In other embodiments, the set of data samples 307 may be a set of unlabelled data samples.

[0145] STEP 904: acquiring, by the electronic device, a pre-trained model from the model database

[0146] At step 904, the electronic device 301 is configured to acquire the pre-trained model 308. In some embodiments the set of pre-trained models 207 includes at least one of a ResNet model, a DenseNet model, and a Transformer-based model.

[0147] STEP 906: generating, by the electronic device using an energy function, an energy score for a given sample from the set of data samples using the pre-trained model

[0148] At step 906, the electronic device 301 is configured to generate an energy score for a given sample from the set of data samples 307 using the pre-trained model 308. For example, the electronic device 301 may generate an energy score s1 from the energy scores 510 for the given sample using the equation 1. It is contemplated that the electronic device 301 may be configured to generate the energy scores 510 in a similar manner.

[0149] STEP 908: ranking, by the electronic device, the set of data samples using the energy score for the given data sample, thereby generating a ranked list of data samples

[0150] At step 908, the electronic device 301 is configured to rank the set of data samples 307 using the energy score for the data sample, thereby generating the ranked list of data samples 514. T is contemplated that the electronic device 301 may generate energy scores for respective data samples from the data samples 307 and rank those data samples 307 using their respective energy scores.

[0151] STEP 910: generating, by the electronic device, the search results using the ranked list of data samples, the search results including the given data sample, the given data sample being a highest-ranked data sample in the ranked list of data samples

[0152] At step 910, the electronic device 301 is configured to generate search results using the ranked list of data samples 514. The search results include the given data sample. The given data sample is a highest-ranked data sample in the ranked list of data samples 514. It should be noted that the search results may include top N data samples from the ranked list of data samples 514, without departing from the scope of the present technology.

[0153] Modifications and improvements to the above-described implementations of the present technology may become apparent to those skilled in the art. The foregoing description is intended to be exemplary rather than limiting. The scope of the present technology is therefore intended to be limited solely by the scope of the appended claims.

Claims

1.A method of generating search results, the method executable by an electronic device, the electronic device being communicatively coupled to a sample database and a model database, the method comprising:acquiring, by the electronic device, a set of data samples from the sample database;acquiring, by the electronic device, a set of pre-trained models from the model database;generating, by the electronic device using an energy function, an energy score for a given model from the set of pre-trained models using the set of data samples; andranking, by the electronic device, the set of pre-trained models using the energy score for the given model, thereby generating a ranked list of pre-trained models; andgenerating, by the electronic device, the search results using the ranked list of pre-trained models, the search results including the given model, the given model being a highest-ranked model in the ranked list of pre-trained models.2.The method of claim 1, wherein the set of data samples includes at least one of a text sample, an image sample, an audio sample, and a video sample.3.The method of any one of claims 1 and 2, wherein the set of data samples is a set of unlabelled data samples.4.The method of any one of claims 1 to 3, wherein the set of pre-trained models includes at least one of a ResNet model, a DenseNet model, and a Transformer-based model.5.The method of any one of claims 1 to 4, wherein the method further comprises fine-tuning, by the electronic device, the target model using the set of data samples.6.The method of any one of claims 1 to 5, wherein the energy function is: wherein fi is the given model, xj is a given data sample from the plurality of data samples, l is a real-valued logits for a pair (xj, fi) .7.The method of claim 6, wherein the energy score is: wherein si is the energy score for the given model, X is the plurality of data samples, N is a number of data samples in the plurality of data samples.8.The method of any one of claims 1 to 7, wherein the method further comprises:acquiring, by the electronic device, a textual query;generating, by the electronic device, a text-based score for the given model using the textual query and textual information associated with the given model;and wherein the ranking comprises:ranking, by the electronic device, the set of pre-trained models using the energy score and the text-based score.9.A method of generating search results, the method executable by an electronic device, the electronic device being communicatively coupled to a sample database and a model database, the method comprising:acquiring, by the electronic device, a set of data samples from the sample database;acquiring, by the electronic device, a pre-trained model from the model database;generating, by the electronic device using an energy function, an energy score for a given sample from the set of data samples using the pre-trained model; andranking, by the electronic device, the set of data samples using the energy score for the given data sample, thereby generating a ranked list of data samples; andgenerating, by the electronic device, the search results using the ranked list of data samples, the search results including the given data sample, the given data sample being a highest-ranked data sample in the ranked list of data samples.10.The method of claim 1, wherein the set of data samples includes at least one of a text sample, an image sample, an audio sample, and a video sample.11.The method of any one of claims 9 to 10, wherein the set of data samples is a set of unlabelled data samples.12.The method of any one of claims 9 to 11, wherein the pre-trained model is at least one of a ResNet model, a DenseNet model, and a Transformer-based model.13.The method of any one of claims 9 to 12, the method further comprises fine-tuning, by the electronic device, the pre-trained model using the given data sample.14.The method of any one of claims 9 to 13, wherein the energy function is: wherein E (xj; fi) is the energy score for the given data sample xj , fi is the pre-trained model, l is a real-valued logits for a pair (xj, fi) .15.The method of any one of claims 9 to 14, wherein the method further comprises:acquiring, by the electronic device, a textual query;generating, by the electronic device, a text-based score for the given data sample using the textual query and textual information associated with the given data sample;and wherein the ranking comprises:ranking, by the electronic device, the set of data samples using the energy score and the text-based score.16.An electronic device for generating search results, the electronic device being communicatively coupled to a sample database and a model database, the electronic device being configured to:acquire a set of data samples from the sample database;acquire a set of pre-trained models from the model database;generate, using an energy function, an energy score for a given model from the set of pre-trained models using the set of data samples; andrank the set of pre-trained models using the energy score for the given model, thereby generating a ranked list of pre-trained models; andgenerate the search results using the ranked list of pre-trained models, the search results including the given model, the given model being a highest-ranked model in the ranked list of pre-trained models.17.The electronic device of claim 16, wherein the set of data samples includes at least one of a text sample, an image sample, an audio sample, and a video sample.18.The electronic device of any one of claims 16 and 17, wherein the set of data samples is a set of unlabelled data samples.19.The electronic device of any one of claims 16 to 18, wherein the set of pre-trained models includes at least one of a ResNet model, a DenseNet model, and a Transformer-based model.20.The electronic device of any one of claims 16 to 19, wherein the method further comprises fine-tuning, by the electronic device, the target model using the set of data samples.21.The electronic device of any one of claims 16 to 20, wherein the energy function is:  wherein fi is the given model, xj is a given data sample from the plurality of data samples, l is a real-valued logits for a pair (xj, fi) .22.The electronic device of claim 21 wherein the energy score is: wherein si is the energy score for the given model, X is the plurality of data samples, N is a number of data samples in the plurality of data samples.23.The electronic device of any one of claims 16 to 22, wherein the electronic device is further configured to:acquire a textual query;generate a text-based score for the given model using the textual query and textual information associated with the given model;and wherein to rank, the electronic device is configured to:rank the set of pre-trained models using the energy score and the text-based score.24.An electronic device for generating search results, the electronic device being communicatively coupled to a sample database and a model database, the electronic device being configured to:acquire a set of data samples from the sample database;acquire a pre-trained model from the model database;generate, using an energy function, an energy score for a given sample from the set of data samples using the pre-trained model; andrank the set of data samples using the energy score for the given data sample, thereby generating a ranked list of data samples; andgenerate the search results using the ranked list of data samples, the search results including the given data sample, the given data sample being a highest-ranked data sample in the ranked list of data samples.25.The electronic device of claim 24, wherein the set of data samples includes at least one of a text sample, an image sample, an audio sample, and a video sample.26.The electronic device of any one of claims 24 to 25, wherein the set of data samples is a set of unlabelled data samples.27.The electronic device of any one of claims 24 to 26, wherein the pre-trained model is at least one of a ResNet model, a DenseNet model, and a Transformer-based model.28.The electronic device of any one of claims 24 to 27, the method further comprises fine-tuning, by the electronic device, the pre-trained model using the given data sample.29.The electronic device of any one of claims 24 to 28, wherein the energy function is: wherein E (xj; fi) is the energy score for the given data sample xj , fi is the pre-trained model, l is a real-valued logits for a pair (xj, fi) .30.The electronic device of any one of claims 24 to 29, wherein the electronic device is further configured to:acquire a textual query;generate a text-based score for the given data sample using the textual query and textual information associated with the given data sample;and wherein to rank, the electronic device is configured to:rank the set of data samples using the energy score and the text-based score.

Citation Information

Patent Citations

  • A facial feature localization method based on the facial feature correlation AAM model

    CN102270308A

  • Text line detection in images

    US20160026899A1

  • Information Processing Apparatus and Information Processing Method

    US20190130295A1

  • Information processing method and information processing system

    US20210256179A1