Artificial intelligence-based model search method, apparatus, and electronic device

By generating multiple neural network models and using Bayesian optimization and Gaussian process models to fit the relationship between the degree of difference and performance indicators, the best-performing model is selected for data tasks. This solves the problem of insufficient execution accuracy of neural network models in existing technologies and achieves efficient model search and data task execution.

CN112561031BActive Publication Date: 2025-12-09INSTITUTE OF INFORMATION ENGINEERING CHINESE ACADEMY OF SCIENCES +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011287865.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-17
Publication Date
2025-12-09
Estimated Expiration
2040-11-17

AI Technical Summary

Technical Problem

In existing technologies, artificially constructed neural network models often fail to achieve good performance in data tasks, making it difficult to achieve efficient model search and data task execution.

Method used

By generating multiple neural network models with different structures, the degree of difference is determined. Bayesian optimization and Gaussian process models are used to fit the functional relationship between performance index and degree of difference. The process is iterative, and the neural network model with the highest performance index is selected for the data task.

Benefits of technology

It improves the performance of neural network model search and the accuracy of data task execution, reduces the consumption of computing resources, and improves the efficiency of model search and data task execution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112561031B_ABST
    Figure CN112561031B_ABST
Patent Text Reader

Abstract

The application provides a model search method and device based on artificial intelligence, an electronic device and a computer readable storage medium; relates to the field of artificial intelligence and big data technology in the field of cloud technology; the method comprises the following steps: generating a plurality of neural network models with different structures; determining the difference degree between the benchmark neural network model and each neural network model; performing the following iterative processing: fitting the function relationship between the difference degree and the performance index of at least part of the neural network models, performing difference degree sampling processing according to the function proxy model obtained by fitting processing, and taking the neural network model corresponding to the difference degree obtained by the difference degree sampling processing as the neural network model used for the next round of iterative processing; when the iterative processing stops, performing a data task according to the neural network model with the highest performance index obtained by the iterative processing. Through the application, the accuracy of performing a data task can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to artificial intelligence technology and cloud technology, and particularly relates to a model search method and device based on artificial intelligence, an electronic device and a computer readable storage medium. BACKGROUND

[0002] Artificial intelligence (AI) is to use a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use the knowledge to obtain the best results. Machine learning (ML) is an important branch of artificial intelligence, which is dedicated to studying how computers simulate or implement human learning behavior to acquire new knowledge or skills, and reorganize existing knowledge structure to continuously improve the performance of the system.

[0003] An artificial neural network (ANN) is a commonly used technology in the field of machine learning, which mainly simulates the behavior characteristics of animal neural networks to perform distributed parallel information processing to perform specific data tasks. In the scheme provided by the related technology, the structure of the neural network model is usually constructed artificially. However, the execution accuracy of the artificially constructed neural network model cannot achieve good results when facing data tasks. SUMMARY

[0004] The embodiments of the present application provide a model search method and device based on artificial intelligence, an electronic device and a computer readable storage medium, which can realize automatic generation and automatic search of neural network models and improve the accuracy of executing data tasks according to the searched neural network models.

[0005] The technical scheme of the embodiments of the present application is implemented as follows:

[0006] The embodiments of the present application provide a model search method based on artificial intelligence, comprising:

[0007] Generating a plurality of neural network models with different structures;

[0008] Taking any one of the neural network models as a reference neural network model, and determining the difference degree between the reference neural network model and each neural network model;

[0009] perform the following iterative processing: fitting processing is performed on a function relationship between the difference degree of at least part of the neural network model and the performance indicator, difference degree sampling processing is performed according to a function proxy model obtained through the fitting processing, and a neural network model corresponding to the difference degree obtained through the difference degree sampling processing is used as a neural network model for performing the next round of iterative processing;

[0010] When the iterative processing stops, a neural network model with the highest performance indicator obtained through the iterative processing is used to perform a data task.

[0011] An embodiment of the present application provides a model search device based on artificial intelligence, comprising:

[0012] A generation module is configured to generate a plurality of neural network models with different structures.

[0013] A difference determination module is configured to use any one of the neural network models as a reference neural network model, and determine a difference degree between the reference neural network model and each of the neural network models.

[0014] An iteration module is configured to perform the following iterative processing: fitting processing is performed on a function relationship between the difference degree of at least part of the neural network model and the performance indicator, difference degree sampling processing is performed according to a function proxy model obtained through the fitting processing, and a neural network model corresponding to the difference degree obtained through the difference degree sampling processing is used as a neural network model for performing the next round of iterative processing.

[0015] A task execution module is configured to, when the iterative processing stops, use a neural network model with the highest performance indicator obtained through the iterative processing to perform a data task.

[0016] An embodiment of the present application provides an electronic device, comprising:

[0017] A memory is configured to store executable instructions.

[0018] A processor is configured to execute the executable instructions stored in the memory, and implement the model search method based on artificial intelligence provided by an embodiment of the present application.

[0019] An embodiment of the present application provides a computer readable storage medium, which stores executable instructions, and is used to cause a processor to perform the model search method based on artificial intelligence provided by an embodiment of the present application.

[0020] An embodiment of the present application has the following beneficial effects:

[0021] After generating multiple neural network models with different structures, fitting is performed according to a function relationship between a difference degree of at least part of the neural network models and a performance index, so that a next neural network model is sampled to enter a next round of iteration processing, thereby avoiding unnecessary sampling and improving the effect of neural network model search. When the search is completed, that is, the iteration processing stops, a data task is performed according to the neural network model with the highest performance index, thereby improving the execution precision. BRIEF DESCRIPTION OF DRAWINGS

[0022] Figure 1 is a structural schematic diagram of a model search system based on artificial intelligence provided by an embodiment of the present application;

[0023] Figure 2 is a structural schematic diagram of a terminal device provided by an embodiment of the present application;

[0024] Figure 3A is a flowchart of a model search method based on artificial intelligence provided by an embodiment of the present application;

[0025] Figure 3B is a flowchart of a model search method based on artificial intelligence provided by an embodiment of the present application;

[0026] Figure 3C is a flowchart of a model search method based on artificial intelligence provided by an embodiment of the present application;

[0027] Figure 3D is a flowchart of a model search method based on artificial intelligence provided by an embodiment of the present application;

[0028] Figure 4 is a schematic diagram of a search space of a neural network model provided by an embodiment of the present application;

[0029] Figure 5 is a schematic diagram of iteration processing provided by an embodiment of the present application;

[0030] Figure 6 is a flowchart of a model search method based on artificial intelligence provided by an embodiment of the present application;

[0031] Figure 7 is a schematic diagram of a graph edit distance model and Bayesian optimization provided by an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings, and the described embodiments should not be regarded as limiting the present application, and all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0033] In the following description, "some embodiments" are referred to, which describe a subset of all possible embodiments, but it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.

[0034] In the following description, the terms "first\second\third" are only to distinguish similar objects, and do not represent a specific order of the objects, and it can be understood that "first\second\third" can be interchanged in a specific order or sequence as allowed, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In the following description, the term "a plurality of" refers to at least two.

[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0036] Before the embodiments of the present application are further described in detail, the terms and phrases involved in the embodiments of the present application are explained, and the terms and phrases involved in the embodiments of the present application are applicable to the following explanations.

[0037] 1) Neural Networks (NN) model: a complex network system formed by a large number of neurons widely connected with each other, which is also a highly complex nonlinear dynamic learning system with large-scale parallelism, distributed storage and processing, self-organization, self-adaptation and self-learning ability.

[0038] 2) Difference degree: used to describe the dissimilarity between different neural network models, in the embodiments of the present application, the neural network model can be mapped to a structure graph, and the graph edit distance (GED) between two structure graphs is taken as the difference degree between the two neural network models corresponding to the two structure graphs.

[0039] 3) Performance index: refers to the performance index of the neural network model when performing a data task, such as accuracy, precision, recall or F1 score, etc., wherein the F1 score is the harmonic mean of precision and recall.

[0040] 4) data task: refers to a task that can be performed by a neural network model, according to different actual application scenarios, the data task can be different types of tasks, for example, it can be a computer vision task (such as an image classification task, an object detection task, or an image segmentation task) or a natural language processing task (such as a semantic understanding task, a machine translation task, or a robot question and answer task).

[0041] 5) Bayesian optimization: refers to a process of using a proxy model (a function proxy model) to fit the relationship of the real objective function, and actively selecting the neural network model with the most "potential" for iteration according to the fitting result. Bayesian optimization can avoid unnecessary sampling, effectively use historical search to improve search efficiency, and obtain the optimal solution of the objective function relationship in a small number of evaluations. The objective function relationship is the functional relationship between the difference degree and the performance indicator.

[0042] 6) Gaussian process (GP): a kind of stochastic process, which is a combination of a series of random variables subject to a normal distribution in an exponential set, and can be regarded as an extension of a multi-dimensional Gaussian distribution to an infinite-dimensional random process. In the embodiments of the present application, the Gaussian process model (used to describe the Gaussian process) can be used as a function proxy model in the Bayesian optimization process. For each legal input, a corresponding Gaussian distribution (i.e. mean and variance) can be determined by the Gaussian process model.

[0043] 7) Acquisition function: also known as extraction function, used to purposefully select the next sampling point based on the function proxy model, that is, to select the best sampling point for the next iteration. In the embodiments of the present application, the acquisition function is used to perform difference degree sampling processing, and the sampling effect indicator in the difference degree sampling processing is the function value of the acquisition function.

[0044] 8) Attention encoding processing: essentially a weighted summation processing, used to determine the key part of the input feature (such as the difference feature in the embodiments of the present application), and to extract the key part to obtain the output feature.

[0045] 9) Big data: refers to a collection of data that cannot be captured, managed, and processed within a certain time range by conventional software tools, and is a massive, high-growth, and diversified information asset that requires new processing modes to have stronger decision-making, insight discovery, and process optimization capabilities. In the embodiments of the present application, big data technology can be used to implement model search, such as generating a neural network model, determining a difference degree, and performing iteration processing.

[0046] The embodiment of the present application provides a model search method and device based on artificial intelligence, an electronic device and a computer readable storage medium, which can improve the effect of model search and improve the accuracy and efficiency of performing a data task according to the searched neural network model. The following describes an exemplary application of the electronic device provided by the embodiment of the present application. The electronic device provided by the embodiment of the present application can be implemented as various types of terminal devices, and can also be implemented as a server.

[0047] Referring to Figure 1 , Figure 1 is an architecture schematic diagram of a model search system 100 based on artificial intelligence provided by the embodiment of the present application. The terminal device 400 is connected to the server 200 through the network 300, and the server 200 is connected to the database 500. The network 300 can be a wide area network or a local area network, or a combination of the two.

[0048] In some embodiments, taking the electronic device as a terminal device for example, the model search method based on artificial intelligence provided by the embodiment of the present application can be implemented by the terminal device, and is suitable for a scenario where the terminal device has strong computing capability. For example, the terminal device 400 runs the client 410, the client 410 generates a plurality of neural network models with different structures, and determines the difference degree between the benchmark neural network model (any one neural network model) and each neural network model. At the same time, the client 410 can determine the performance indicators of at least part of the neural network models according to the training set and the test set of the data task. The training set and the test set of the data task can be pre-stored in the local client 410, or can be obtained from the server 200 or other devices. Then, the client 410 performs fitting processing on the function relationship between the difference degree and the performance indicators of at least part of the neural network models, performs difference degree sampling processing according to the function proxy model obtained by the fitting processing, and takes the neural network model corresponding to the difference degree obtained by the difference degree sampling processing as the neural network model used for the next round of iteration processing. When the iteration processing stops, the client 410 can store the neural network model with the highest performance indicator obtained by the iteration processing in the local, and call the neural network model to perform the data task.

[0049] In some embodiments, taking the server as an example, the model search method based on artificial intelligence provided by the embodiments of the present application can also be implemented by the server. For example, the server 200 can generate a plurality of neural network models with different structures, and perform iterative processing according to the determined difference degree and performance indicators, wherein the server 200 can obtain the training set and test set of the data task from the database 500 to determine the performance indicators of the neural network model. When the iterative processing stops, the server 200 can store the neural network model with the highest performance indicator obtained by the iterative processing locally, such as in a distributed file system, and in subsequent calls, the neural network model is used to execute the data task, or the server 200 can also send the neural network model to the client 410, so that the client 410 executes the data task according to the received neural network model.

[0050] It is worth noting that compared with the scheme provided by the related art, the embodiments of the present application can search for a neural network model with better effect and smaller complexity, thereby improving the actual utilization effect of the training set and test set (such as the training set and test set stored in the database 500) used in the search process. From another angle, for the neural network model with the highest performance indicator searched, the electronic device (such as the server 200 or the terminal device 400 shown in the figure) can improve the execution accuracy of the data task when executing the data task through the neural network model, thereby improving the actual utilization rate of the computing resources consumed by the electronic device when executing the data task. At the same time, since the complexity of the searched neural network model is small, the computing resources consumed by the electronic device when executing the data task can be saved. Figure 1

[0051] In Figure 1 , taking the data task as an image classification task as an example. After the server 200 obtains the neural network model with the highest performance indicator through iterative processing, the server 200 can store the neural network model locally. The client 410 can send an image A to be classified to the server 200, and the server 200 can call the stored neural network model to execute the data task for the image A when receiving the image A. After execution, the server 200 sends the obtained classification result to the client 410 to display in the graphical interface of the client 410, that is Figure 1 , the classification result for the human.

[0052] ​In some embodiments, the terminal device 400 or the server 200 can implement the model search method based on artificial intelligence provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or a software module in an operating system; can be a native application program (APP), that is, a program that needs to be installed in an operating system to run, such as an image classification application program (corresponding to the client 410 described above); can also be a mini-program, that is, a program that only needs to be downloaded into a browser environment to run; and can also be a mini-program that can be embedded into any APP. In summary, the above computer program can be any form of application program, module or plug-in.

[0053] In some embodiments, the server 200 can be a standalone physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms, etc. The cloud service can be a model search service or a service for executing data tasks, which is called by the terminal device 400. The terminal device 400 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart television, a smart watch, etc., but is not limited thereto. The terminal device and the server can be connected directly or indirectly through wired or wireless communication, which is not limited in the embodiments of the present application.

[0054] For the case where the electronic device is a server, it can be understood that, Figure 2 some of the structures shown in the above Figure 2 , Figure 2 is a structural schematic diagram of the terminal device 400 provided in the embodiments of the present application, Figure 2 The terminal device 400 shown in FIG. 4 includes at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the terminal device 400 are coupled together through a bus system 440. It can be understood that the bus system 440 is used to realize the connection and communication between the components. In addition to including a data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the bus system 440 in Figure 2 .

[0055] The processor 410 can be an integrated circuit chip that has a processing capability of signals, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc., wherein the general-purpose processor can be a microprocessor or any conventional processor.

[0056] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432 that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0057] The memory 450 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, etc. The memory 450 optionally includes one or more storage devices physically located in proximity to the processor 410.

[0058] The memory 450 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. Non-volatile memory can be read only memory (ROM), and volatile memory can be random access memory (RAM). The memory 450 described in embodiments of the present application is intended to include any suitable type of memory.

[0059] In some embodiments, the memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or a subset or superset thereof, which are described below.

[0060] The operating system 451 includes a system program for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0061] The network communication module 452 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420, examples of which include Bluetooth, wireless compatibility authentication (WiFi), and universal serial bus (USB), etc.

[0062] a presentation module 453 for enabling presentation of information (e.g., a user interface for operating a peripheral device and displaying content and information) via one or more output devices 431 (e.g., a display screen, a speaker, etc.) associated with the user interface 430;

[0063] an input processing module 454 for detecting and translating one or more user inputs or interactions from one or more input devices 432.

[0064] In some embodiments, the apparatus provided by the embodiments of the present application can be implemented in software, Figure 2 An artificial intelligence-based model search apparatus 455 stored in the memory 450 is shown, which can be software in the form of programs and plug-ins, etc., including the following software modules: a generation module 4551, a difference determination module 4552, an iteration module 4553, and a task execution module 4554. These modules are logical, and thus can be combined or further split according to the implemented functions. The functions of each module will be described below.

[0065] The artificial intelligence-based model search method provided by the embodiments of the present application will be described in conjunction with an exemplary application and implementation of an electronic device provided by the embodiments of the present application.

[0066] Referring to Figure 3A , Figure 3A is a flowchart of an artificial intelligence-based model search method provided by the embodiments of the present application, which will be described in conjunction with Figure 3A the steps shown.

[0067] In step 101, a plurality of neural network models with different structures are generated.

[0068] Here, for a data task to be performed, a plurality of neural network models with different structures are first generated as a search space for model search. As an example, the embodiments of the present application provide a search space as shown in Figure 4 , which includes neural network models 1 to N, where N is an integer greater than 1, for example, can be 1000. The purpose of the embodiments of the present application is to search for a neural network model with the best effect from the plurality of neural network models included in the search space to perform the data task. The way to generate the neural network model can be set according to the actual application scenario, for example, the number of neurons can be increased or decreased based on an existing initial neural network model, connections between different neurons can be established or deleted, etc.

[0069] In step 102, any one of the neural network models is taken as a reference neural network model, and the difference between the reference neural network model and each neural network model is determined.

[0070] Herein, a neural network model in the search space is randomly selected as a benchmark neural network model, and the difference degree between the benchmark neural network model and each neural network model in the search space is calculated. The difference degree is a direct embodiment of dissimilarity, that is, the smaller the difference degree between two neural network models, the more similar the two neural network models. As an example, in the case of the benchmark neural network model being neural network model 1, the difference degree between neural network model 1 and neural network model 2, the difference degree between neural network model 1 and neural network model 3, and the difference degree between neural network model 1 and neural network model N need to be determined. Figure 4

[0071] The manner of calculating the difference degree is not limited in the embodiments of the present application, for example, the difference degree can be calculated by a structure-related parameter, wherein the structure-related parameter can include at least one of the number of neurons and the number of neuron connection edges of the neural network model, and of course other parameters can also be included.

[0072] For example, if the benchmark neural network model is model A and a neural network model in the search space is model B, the difference degree between model A and model B is w1x│number of neurons included in model A-number of neurons included in model B│+w2x│number of neuron connection edges included in model A-number of neuron connection edges included in model B│, wherein w1 and w2 are both numbers greater than zero, and ││ is an absolute value operation.

[0073] It is worth noting that the difference degree between the benchmark neural network model and itself is zero.

[0074] In step 103, the following iterative processing is performed: fitting processing is performed on the functional relationship between the difference degree and the performance indicator of at least part of the neural network model, difference degree sampling processing is performed according to the function proxy model obtained by the fitting processing, and the neural network model corresponding to the difference degree obtained by the difference degree sampling processing is used as the neural network model for the next round of iterative processing.

[0075] For example, random selection can be performed in the search space to obtain neural network models that meet the quantity threshold, and the performance indicators of these neural network models when performing data tasks are determined. The higher the performance indicator, the more suitable the corresponding neural network model is for performing data tasks. The quantity threshold is an integer greater than 1, which can be set according to the actual application scenario, for example, set to 100. As an example, the embodiments of the present application provide a method for performing data tasks as shown in Figure 5 ​The schematic diagram of the iterative processing is shown. Taking the process of the i th round of iterative processing as an example, the neural network models participating in the i th round of iterative processing can be neural network models 1 to K, where K is an integer, 1 < K < N (here N refers to Figure 4 N in the formula), and i is an integer greater than zero.

[0076] Then, the iterative processing is performed on all neural network models with performance indicators (i.e., performance indicators have been determined). In the process of the iterative processing, the actual function relationship between the difference degree of the neural network model (here referring to all neural network models with performance indicators) and the performance indicator is fitted to obtain a function proxy model representing the function relationship, and then the difference degree sampling processing (i.e., sampling the next difference degree with the best effect) is performed according to the function proxy model. The neural network model corresponding to the difference degree obtained by the difference degree sampling processing is used as the neural network model for the next round of iterative processing. That is, each round of iterative processing includes fitting processing and difference degree sampling processing. According to the difference degree sampling processing according to the function proxy model, unnecessary sampling can be avoided as much as possible, thereby improving the effect of model search.

[0077] In some embodiments, the neural network model corresponding to the difference degree obtained by the difference degree sampling processing can be used as the neural network model for the next round of iterative processing in the following manner: determining the performance indicator of the sampled neural network model; wherein the sampled neural network model is the neural network model corresponding to the difference degree obtained by the difference degree sampling processing; and using the sampled neural network model and other neural network models with performance indicators as the neural network models for the next round of iterative processing.

[0078] In order to distinguish, the neural network model corresponding to the difference degree obtained by the difference degree sampling processing is named as the sampled neural network model. For each round of iterative processing, after obtaining the sampled neural network model, the performance indicator of the sampled neural network model is determined, and all neural network models with performance indicators (including the sampled neural network model) are used as the neural network models for the next round of iterative processing. As Figure 5 shown, the neural network models participating in the i+1 th round of iterative processing include the neural network models participating in the i th round of iterative processing (i.e., neural network models 1 to K) and the sampled neural network model obtained in the process of the i th round of iterative processing.

[0079] In step 104, when the iterative processing stops, the neural network model with the highest performance indicator obtained by the iterative processing is used to perform the data task.

[0080] In the embodiments of the present application, a stop condition can be set for the iterative processing, and when the stop condition is met, the iterative processing is stopped. Then, the neural network model with the highest performance index obtained by the iterative processing is determined to perform the data task, i.e., the search of the search space is completed. The neural network model obtained by the iterative processing refers to all neural network models with performance indexes.

[0081] In some embodiments, before step 103, the method further includes training the neural network model by using a training set of the data task, and determining the performance index of the trained neural network model by using a test set of the data task. The above-mentioned implementation of performing the data task by using the neural network model with the highest performance index obtained by the iterative processing can be achieved by determining the trained neural network model with the highest performance index from the plurality of trained neural network models obtained by the iterative processing to perform the data task.

[0082] For example, before the iterative processing, the performance index of each neural network model that meets the quantity threshold and is randomly selected from the search space in performing the data task is determined. An example of determining the performance index is provided in the embodiments of the present application. First, a data set of the data task is obtained, and the data set includes a plurality of samples, and each sample includes a sample input and a sample output. Taking an image classification task as an example of the data task, the sample input can be an image, and the sample output can be the category of the image, such as human, cat, or dog, etc. Then, the data set is divided into a training set and a test set, and the division ratio can be adjusted according to the actual application scenario, for example, the number of samples included in the training set: the number of samples included in the test set = 7:3. For each neural network model to be determined for the performance index, the neural network model is trained by using the training set, i.e., the weight parameters of the neurons in the neural network model are updated, and the performance index of the trained neural network model is determined by using the test set. Here, all the neural network models use the same training set and the same test set. It should be noted that when the plurality of neural network models are generated by using step 101, the weight parameters of all the neurons in each neural network model can be initialized as a set parameter.

[0083] Taking a certain sample in the training set as an example to illustrate the training process, the sample input in the sample is first processed by the neural network model to obtain a predicted output, then a loss value is calculated by using a loss function on the predicted output and the sample output in the sample, and then the weight parameters of the neural network model are updated according to the loss value by using back propagation, wherein the type of the loss function is not limited, for example, it can be a cross-entropy loss function.

[0084] For each sample in the test set, the sample input in the sample is forward propagated by the neural network model to obtain a predicted output. Then, according to the difference between the sample output of each sample in the test set and the corresponding predicted output, the performance indicator of the neural network model is determined. The higher the performance indicator, the better the effect of the neural network model in performing the data task, where the performance indicator can be accuracy, precision, recall or F1 score, etc., which is not limited.

[0085] It is worth noting that for each iteration process, after obtaining the sampled neural network model, the performance indicator of the sampled neural network model can also be determined by the training set and the test set. In addition, when the iteration process stops, among all the trained neural network models with performance indicators, the trained neural network model with the highest performance indicator is determined to perform the data task, so as to further improve the execution effect of the data task.

[0086] For the convenience of understanding, taking the data task as an image classification task as an example, the process of performing the image classification task by a certain trained neural network model, i.e., forward propagation, is described. For the image to be classified, the weights of the neurons in the trained neural network model are used to weight the image (here, the representation data of the image, such as a pixel matrix), and finally the probabilities corresponding to the plurality of set categories are obtained. Then, the set category with the highest probability is taken as the output of the trained neural network model, i.e., the classification result of the image. For example, the set categories include human, cat and dog, and the obtained probabilities are 0.7, 0.2 and 0.1 respectively. Since the probability of human is the highest, human is taken as the category of the image.

[0087] In some embodiments, the iteration process is stopped when one of the following conditions is met: the number of iterations that have been performed reaches a number threshold; the duration of the iteration that has been performed reaches a duration threshold; the difference between the sampling performance indicators of two consecutive iterations is less than a difference threshold; wherein the sampling performance indicator is the performance indicator of the sampled neural network model; and the sampled neural network model is the neural network model corresponding to the difference degree obtained by the difference degree sampling process.

[0088] The embodiments of the present application provide three stopping conditions for the iteration process, which are described below.

[0089] 1) The number of iterations is constrained, i.e., when the number of iterations that have been performed reaches a number threshold, the iteration process is stopped.

[0090] 2) The duration of the iteration is constrained, i.e., when the duration of the iteration that has been performed reaches a duration threshold, the iteration process is stopped.

[0091] 3) a constraint on the difference between the indicators of two consecutive rounds, that is, when the difference between the indicators of two consecutive rounds (i.e., the current round and the last round) of iterative processing is less than the difference threshold, it is proved that the search has tended to be stable, and then the iterative processing is stopped. Among them, the sampling performance indicator refers to the performance indicator of the sampling neural network model obtained in the iterative processing process. In actual application scenarios, if the requirement for model search is high, the difference between three consecutive rounds, four consecutive rounds or even more consecutive rounds can also be constrained.

[0092] It is worth noting that the number of rounds threshold and the time length threshold mentioned above can be set according to the actual application scenario, and no limitation is made. Through the above-mentioned manner, the flexibility of the stop condition can be improved.

[0093] As shown in Figure 3A , the embodiment of the present application searches the neural network model in the search space based on the difference degree and the performance indicator combined with the principle of Bayesian optimization, which can search the neural network model with high performance indicator at a small cost (i.e., determine the performance indicator of a small part of the neural network model in the search space), thereby improving the accuracy and efficiency of executing data tasks.

[0094] In some embodiments, referring to Figure 3B , Figure 3B is a flowchart of a model search method based on artificial intelligence provided by the embodiment of the present application, Figure 3A The step 103 shown in the figure can be implemented by steps 201 to 204, which will be described in combination with each step.

[0095] In step 201, in the i-th round of iterative processing, the function relationship between the difference degree and the performance indicator of at least part of the neural network model is fitted to obtain a Gaussian process model.

[0096] Here, for the sake of understanding, the i-th round of iterative processing is described. In the i-th round of iterative processing, first, the function relationship between the difference degree and the performance indicator of all neural network models participating in the i-th round of iterative processing is fitted to obtain a function proxy model. The function proxy model can be a Gaussian process model, a random forest model or a tree structure Parzen estimator (TPE) model, etc. For the sake of understanding, the case where the function proxy model is a Gaussian process model is described here. The Gaussian process model is used to describe the Gaussian distribution of the difference degree, that is, for each legal difference degree input, the Gaussian process model will output the corresponding mean and variance of the performance indicator, and the standard deviation can be obtained by performing arithmetic square root processing on the variance.

[0097] In step 202, in the iteration processing of the i th round, the performance index of any one difference degree is predicted by the Gaussian process model, and the mean and standard deviation of the performance index obtained by the prediction processing are fused to obtain the sampling effect index of any one difference degree.

[0098] For example, for any one difference degree, the difference degree can be predicted by the Gaussian process model to obtain the mean and standard deviation. Then, the difference degree sampling processing can be performed based on the obtained mean and standard deviation. In the embodiments of the present application, the difference degree sampling processing has two directions, one is exploration (Explore), that is, it is desired to select data with a larger variance (or standard deviation) to explore new space, and the other is exploitation (Exploit), that is, it is desired to select data close to the maximum mean to strengthen (utilize) the existing results. Here, the acquisition function can be used to balance the two directions to obtain better sampling effect. For example, the mean and standard deviation are fused by the acquisition function to obtain the sampling effect index of the difference degree. The specific form of the acquisition function is not limited in the embodiments of the present application, which will be illustrated by examples later.

[0099] In some embodiments, the fusion of the mean and standard deviation of the performance index obtained by the prediction processing to obtain the sampling effect index of any one difference degree can be achieved in the following way: the mean is subtracted from the highest performance index obtained by the iteration processing to obtain an index difference; the index difference is divided by the standard deviation to obtain a first intermediate parameter; the first intermediate parameter is processed by the cumulative distribution function of the Gaussian process model to obtain a first function value; the first intermediate parameter is processed by the probability density function of the Gaussian process model to obtain a second function value; the index difference is used as the weight of the first function value, and the standard deviation is used as the weight of the second function value, so as to weight the first function value and the second function value to obtain the sampling effect index.

[0100] In the embodiments of the present application, the acquisition function can be an expected improvement (EI) function, which is used to estimate the expected value of the gain of a new measurement value (i.e. the sampling performance index) compared with the historical optimal value (i.e. the highest performance index among all the determined performance indexes). In order to facilitate understanding, the formula is as follows:

[0101]

[0102]

[0103] Wherein, x represents any one difference degree, μ(x) represents the mean, σ(x) represents the standard deviation, Z represents the first intermediate parameter, f(x +represents the highest performance indicator among all the determined performance indicators, μ(x) - f(x + represents the indicator difference. In addition, Φ() represents a cumulative distribution function (CDF) of a Gaussian distribution described by a Gaussian process model, Φ(z) represents a first function value; φ() represents a probability density function (PDF) of a Gaussian distribution described by a Gaussian process model, φ(z) represents a second function value. Finally, the first function value and the second function value are weighted and summed, and the sampling effect indicator EI(x) is obtained. It should be noted that in the case of a standard deviation σ(x) of zero, the sampling effect indicator EI(x) is directly determined to be zero.

[0104] In some embodiments, the above-mentioned fusion processing of the mean and the standard deviation of the performance indicators obtained through prediction processing to obtain a sampling effect indicator of any one difference degree can be implemented in the following manner: the mean is subtracted by the highest performance indicator obtained through iteration processing to obtain an indicator difference; the indicator difference is subtracted by a set trade-off parameter, and the obtained result is divided by the standard deviation to obtain a second intermediate parameter; the second intermediate parameter is processed through a cumulative distribution function of a Gaussian process model to obtain the sampling effect indicator.

[0105] In the embodiments of the present application, the acquisition function can also be a probability of improvement (PI) function, which is used to estimate the probability that a new measurement value is better than the historical optimal value. In order to facilitate understanding, the formula is explained as follows:

[0106]

[0107] wherein ξ represents a trade-off parameter, also referred to as a trade-off coefficient, and the sampling is controlled to be biased towards Explore or Exploit by adjusting the size of the trade-off parameter. represents the second intermediate parameter, and the finally obtained sampling effect indicator is PI(x).

[0108] In some embodiments, the above-mentioned fusion processing of the mean and the standard deviation of the performance indicators obtained through prediction processing to obtain a sampling effect indicator of any one difference degree can be implemented in the following manner: any one of the following processing is performed: the mean and the weighted standard deviation are summed to obtain the sampling effect indicator; the mean is subtracted by the weighted standard deviation to obtain the sampling effect indicator.

[0109] In the embodiments of the present application, the acquisition function can also be an Upper Confidence Bound (UCB) function for estimating the maximum value of the confidence interval of the new measurement value. For ease of understanding, the formula is as follows:

[0110] UCB(x) = μ(x) + kσ(x)

[0111] where k represents the weight for weighting the standard deviation σ(x), and the obtained sampling effect index is UCB(x).

[0112] In addition, the acquisition function can also be a Lower Confidence Bound (LCB) function for estimating the minimum value of the confidence interval of the new measurement value. For ease of understanding, the formula is as follows:

[0113] LCB(x) = μ(x) - kσ(x)

[0114] where the obtained sampling effect index is LCB(x).

[0115] In the above manner, the flexibility of fusion processing is improved, and according to different actual application scenarios, any one of the EI function, the PI function, the UCB function or the LCB function can be used to obtain the sampling effect index corresponding to the difference degree.

[0116] In step 203, in the i-th round of iterative processing, the difference degree with the highest sampling effect index is determined from the plurality of difference degrees, as the difference degree obtained by the difference degree sampling processing.

[0117] Here, from the plurality of difference degrees determined by step 102, the difference degree with the highest corresponding sampling effect index is determined as the difference degree obtained by the difference degree sampling processing, that is, the sampling point obtained by the i-th round of iterative processing.

[0118] In step 204, in the i-th round of iterative processing, the neural network model corresponding to the difference degree obtained by the difference degree sampling processing is used as the neural network model for the i+1-th round of iterative processing.

[0119] As shown in Figure 3B , the embodiments of the present application obtain the Gaussian process model through fitting processing, and perform difference degree sampling processing in combination with the Gaussian process model and the acquisition function, which can improve the sampling effect, that is, improve the probability of searching for a high-quality neural network model.

[0120] In some embodiments, referring to Figure 3C , Figure 3C is a flowchart of a model search method based on artificial intelligence provided by the embodiments of the present application,Figure 3A The step 102 shown can be implemented by steps 301 to 303, which will be described in combination with the steps.

[0121] In step 301, any one neural network model in the search space is taken as the reference neural network model.

[0122] Here, any one neural network model in the search space is taken as the reference neural network model.

[0123] In step 302, the reference neural network model is mapped into a reference structure graph, and the target neural network model is mapped into a target structure graph.

[0124] In the embodiments of the present application, the difference degree between different neural network models can be represented by calculating the graph edit distance between different structure graphs. First, the reference neural network model is mapped into a reference structure graph, and the target neural network model is mapped into a target structure graph, where the target neural network model is any one neural network model in the search space (which can be the reference neural network model). Since the connections between neurons in the neural network model are directed, the structure graph mapped here can be a directed acyclic graph.

[0125] In step 303, the graph edit distance when converting the reference structure graph into the target structure graph is determined as the difference degree between the reference neural network model and the target neural network model.

[0126] The graph edit distance refers to the sum of the minimum edit operation cost value required to convert the source graph into the target graph (i.e. the minimum number of edit operations required), which can better express the dissimilarity between graphs. Here, the edit operation can include 6 kinds, including node (neuron) deletion, insertion and replacement operations, and edge (connection between neurons) deletion, insertion and replacement operations. After obtaining the reference structure graph and the target structure graph, the graph edit distance when converting the reference structure graph into the target structure graph can be determined as the difference degree between the reference neural network model and the target neural network model, where the graph edit distance when converting the reference structure graph into the target structure graph can be determined by a graph edit distance model, such as a heuristic algorithm-based graph edit distance model or a depth-first search-based graph edit distance model.

[0127] In some embodiments, the above-mentioned determination of the graph edit distance when converting the reference structure graph into the target structure graph can be implemented in the following way: feature extraction processing is performed on the reference structure graph and the target structure graph, and the difference features between the features of the reference structure graph and the features of the target structure graph are determined; attention encoding processing is performed on the difference features; full connection processing is performed on the difference features after the attention encoding processing, to obtain the graph edit distance when converting the reference structure graph into the target structure graph.

[0128] Here, an example of the graph edit distance model is provided, which can include a graph convolutional network (GCN) model, an attention layer, and a fully connected layer, which are described below. The GCN model is used to perform feature extraction processing on the reference structure graph and the target structure graph, and determine the difference features between the extracted features of the reference structure graph and the extracted features of the target structure graph. The attention layer is used to perform attention encoding processing on the difference features. The attention encoding processing is essentially a weighting processing, and the purpose is to extract the key part of the difference features, i.e., to achieve the reinforcement of the difference features. The fully connected layer is used to perform fully connected processing on the difference features after the attention encoding processing, i.e., to map the difference features after the attention encoding processing to a graph edit distance.

[0129] In the training phase of the graph edit distance model, the graph edit distance model can be regarded as an end-to-end model, and the graph edit distance model is trained, i.e., the weight parameters of the graph edit distance model are updated, by using a sample source graph, a sample target graph, and a sample graph edit distance when the sample source graph is converted into the sample target graph. The sample source graph and the sample target graph can also be directed acyclic graphs, and the sample graph edit distance can be obtained by manual annotation or by processing a graph edit distance model with higher complexity. In this way, the efficiency of determining the graph edit distance can be improved while ensuring the accuracy of the obtained graph edit distance.

[0130] In some embodiments, before step 303, the method further includes: performing distance calculation processing on the sample source graph and the sample target graph by using a first graph edit distance model to obtain a sample graph edit distance; and training a second graph edit distance model according to the sample source graph, the sample target graph, and the sample graph edit distance. The processing complexity of the first graph edit distance model is greater than that of the second graph edit distance model. The trained second graph edit distance model is used to perform distance calculation processing on the reference structure graph and the target structure graph to obtain the graph edit distance when the reference structure graph is converted into the target structure graph.

[0131] Here, the sample source graph and the sample target graph can be processed by using a first graph edit distance model to obtain a sample graph edit distance. The first graph edit distance model can be a graph edit distance model based on a heuristic algorithm or a graph edit distance model based on a depth-first search, and the processing complexity of the first graph edit distance model is greater than that of the second graph edit distance model. The second graph edit distance model can be the graph edit distance model including the GCN model, the attention layer, and the fully connected layer as described above.

[0132] After obtaining the sample graph edit distance, the second graph edit distance model can be trained according to the sample source graph, the sample target graph, and the sample graph edit distance. In this way, the benchmark structure graph and the target structure graph can be processed by the trained second graph edit distance model to obtain the graph edit distance. The above-mentioned method obtains the sample graph edit distance by processing the first graph edit distance model with high complexity, and then trains the second graph edit distance model with low complexity. In this way, the processing efficiency can be improved when the distance is calculated by the trained second graph edit distance model, and the graph edit distance can be obtained more quickly.

[0133] As shown in Figure 3C , the neural network model is mapped to a structure graph, and the graph edit distance between the structure graphs is used as the difference between the neural network models, which can improve the accuracy of the obtained difference.

[0134] In some embodiments, referring to Figure 3D , Figure 3D is a flowchart of a model search method based on artificial intelligence provided by an embodiment of the present application, Figure 3A The step 101 shown in the figure can be implemented by any one of the steps 401 to 403, which will be described in combination with each step.

[0135] In step 401, a plurality of neural network models with different structures are generated according to a set number of neurons and a set number of neuron connection edges.

[0136] The embodiment of the present application provides three ways to generate neural network models, which will be described separately. The constraint condition in the first way is to set the number of neurons and the number of neuron connection edges, that is, for each generated neural network model, the number of neurons included in the neural network model is equal to the set number of neurons, and the number of neuron connection edges included in the neural network model is equal to the set number of neuron connection edges.

[0137] In step 402, a plurality of neural network models with different structures are generated according to a set number of neurons and a set probability of connection between each two neurons.

[0138] The constraint condition in the second way is to set the number of neurons and the set probability of connection between each two neurons, which can be set according to the actual application scene, such as 10%. For each generated neural network model, the number of neurons included in the neural network model is equal to the set number of neurons.

[0139] In step 403, the initial neural network model is subjected to multiple rounds of genetic processing to obtain multiple neural network models with different structures; wherein each round of genetic processing includes at least one of selection processing, crossover processing and mutation processing.

[0140] In the third approach, multiple rounds of genetic processing can be performed based on the initial neural network model, based on genetic principles, to obtain multiple neural network models. Each round of genetic processing includes at least one of selection, crossover, and mutation processing, which will be explained separately below.

[0141] Selection processing can refer to choosing a subset of neural network models from the previous round of genetic processing to enter the current round of genetic processing. This selection can be random or based on specific probabilities. For the first round of genetic processing, the initial neural network models can be directly selected; alternatively, if there are multiple initial neural network models, a subset of these models can be selected for the first round of genetic processing.

[0142] Crossover processing can refer to determining whether to exchange neurons between any two neural network models based on a set crossover probability. For example, exchanging a local part of neural network model A (e.g., including multiple neurons and connections between them) with a local part of neural network model B.

[0143] Mutation processing can refer to determining whether to mutate each neuron in each neural network model based on a set mutation probability, such as adding another neuron or deleting the neuron itself.

[0144] It should be noted that the selection, crossover, and mutation processes described above are merely examples and do not constitute a limitation on the embodiments of this application.

[0145] The stopping condition for genetic processing can be that the number of genetic processing rounds has reached a set threshold, or the duration of genetic processing has reached a set threshold, etc., and there are no restrictions on this. Furthermore, the neural network model obtained in the last round of genetic processing can be used as the generated neural network model, or the neural network models obtained in all rounds of genetic processing can be used as the generated neural network model.

[0146] like Figure 3D As shown, this application provides three methods for generating neural network models, which improves flexibility and can be selected according to the actual application scenario.

[0147] The embodiments of the present application can be applied to various types of data tasks, such as computer vision tasks or natural language processing tasks, etc. As an example, the embodiments of the present application provide a flowchart of a model search method based on artificial intelligence as shown in Figure 6 The various steps will be described in conjunction with Figure 6 The various steps will be described in conjunction with

[0148] In step 501, a plurality of neural network models with different structures are generated based on a random graph model.

[0149] For example, the neural network model can be a deep neural network (DNN) model, and the diversity of the neural network model structure is the key to ensure that the generated candidate set of neural network models (i.e., the search space) has strong learning expression ability. Since the neural network model can be represented as a directed acyclic graph, in the embodiments of the present application, a plurality of neural network models with diversity can be randomly and quickly generated based on a random graph model.

[0150] For example, the plurality of neural network models can be generated in any one of the following two modes: 1) generating a plurality of neural network models according to a set number of nodes and a set number of edges, wherein the set number of nodes corresponds to the set number of neurons described above, and the set number of edges corresponds to the set number of neuron connection edges described above; 2) generating a plurality of neural network models according to a set number of nodes and a probability of generating an edge between each two nodes, wherein the probability of generating an edge between each two nodes corresponds to the set probability described above. It should be noted that in the embodiments of the present application, in addition to the random graph model, other methods can also be used to generate a plurality of neural network models, such as evolutionary methods (e.g., genetic algorithms).

[0151] A directed acyclic graph g can represent a binary tuple, i.e., g = (V, E). Wherein V represents a set of nodes, E represents a set of edges. The edges in the graph g are represented by the nodes at both ends, for example, a directed edge with a starting node (origin) u and a terminal node (destination) v can be represented as <u, v>. The plurality of generated neural network models can be uniformly represented as a set G, each element g in the set G is a directed acyclic graph, i.e., each element g is a neural network model, and the set G is also the search space of the neural network model in the embodiments of the present application.

[0152] In step 502, the graph edit distance model is trained using the distance data set with annotated sample graph edit distances.

[0153] The concept of graph edit distance is extended from string edit distance to graph structure, and the graph edit distance refers to the sum of the minimum edit operation cost value (i.e., the minimum number of edit operations required) required to convert a source graph into a target graph, which can better express the dissimilarity between graphs. Here, the edit operation can include six kinds, including node deletion, insertion and replacement operations, and also including edge deletion, insertion and replacement operations. For example, the source graph g1=(V1, E1) and the target graph g2=(V2, E2), and the graph edit distance refers to the transformation strength or dissimilarity required to convert the source graph g1 into the target graph g2, which measures the dissimilarity between the two graphs.

[0154] In the embodiment of the present application, the graph edit distance model can be trained by the distance data set D, and each sample in the distance data set D is a triple (g i ,g j ,x ij ), where x ij is the sample graph edit distance from the sample source graph g i to the sample target graph g j . The embodiment of the present application provides a schematic diagram of the graph edit distance model as shown in Figure 7 The graph edit distance model used in the embodiment of the present application can be an end-to-end model, including a GCN model for extracting difference features between graphs, an attention layer for attention encoding processing, and a fully connected layer for full connection processing, of course, Figure 7 The structure shown is only an example and does not constitute a limitation on the graph edit distance model in the embodiment of the present application. The input of the graph edit distance model is two directed acyclic graphs, such as the sample source graph g i and the sample target graph g j , and the output is the graph edit distance between the two directed acyclic graphs.

[0155] It is worth noting that the sample graph edit distance x ij in the distance data set D can be obtained by manual annotation, or calculated by an accurate graph edit distance model (corresponding to the first graph edit distance model in the above) on the sample source graph g i and the sample target graph g j , wherein the accurate graph edit distance model is, for example, a graph edit distance model based on heuristic algorithm or a graph edit distance model based on depth-first search, and the processing complexity of the accurate graph edit distance model is greater than Figure 7 The graph edit distance model shown in Figure 7 The graph edit distance model shown in

[0156] In step 503, a reference neural network model is selected, and the graph edit distance between the reference neural network model and each generated neural network model is calculated.

[0157] Here, one g is randomly selected from the set G generated in step 501 i as the reference neural network model, where 0 < i < N, and N is the number of elements in the set G. Then, the set G is traversed, and the traversed neural network model is denoted as g j , and the graph edit distance x i between the reference neural network model g j and g ij is calculated, obtaining (g j , x ij ). When j = i, (g j , 0) is obtained. Finally, the set X is constructed according to all (g j , x ij ).

[0158] In step 504, the neural network model is continuously selected by Bayesian optimization, trained, and the model evaluation index is obtained, and the proxy model is fitted.

[0159] Bayesian optimization can obtain the optimal solution of a complex function relationship with a small number of evaluations. Essentially, Bayesian optimization uses a proxy model (corresponding to the function proxy model above) to fit the true function relationship, and actively selects the neural network model with the most "potential" for the next iteration according to the fitting result, thereby avoiding unnecessary sampling and effectively utilizing historical search conditions to improve search efficiency. In order to facilitate understanding, the process of Bayesian optimization is described in the form of steps.

[0160] 1) Obtain the data set corresponding to the data task, and divide it into a training set and a test set. Here, taking the computer vision task as an example, the obtained CIFAR-10 data set A is divided into a training set A1 and a test set A2.

[0161] 2) Initialization, randomly select several groups of data (g j , x ij ) from the set X, train the neural network model g j using the training set A1, and use the accuracy y j of the trained g j on the test set A2 as the model evaluation index (corresponding to the performance index above).

[0162] 3) For all g j, a Gaussian Process model is used as a surrogate model to fit the function relationship between the graph edit distance and the model evaluation index. Here, the surrogate model can also use a random forest model or a TPE model, and is not limited to a Gaussian Process model. As an example, Figure 7 The expression of the Gaussian Process model is shown in the following formula: f(x) ~ GP(m(x), k(x, x')). Wherein, x represents the graph edit distance, f(x) represents the model evaluation index, m(x) represents the mathematical expectation E(f(x)) of f(x), and k(x, x') is a kernel function used to describe the covariance of x.

[0163] 4) The next sampling point is determined by balancing between exploring the uncertainty area and utilizing the area known to have a better model evaluation index through the acquisition function. Here, taking the EI function as an example, the EI function will select the point with the maximum expected improvement as the next sampling point, which is denoted as x*. As an example, Figure 7 The formula x t+1 = max x∈X a t (x; D 1:t ), wherein x t+1 is the next sampling point x*, a t (x; D 1:t ) represents the acquisition function, and D 1:t represents the t sets of observation data used for fitting in the current iteration process, and each set of observation data includes a graph edit distance and a model evaluation index.

[0164] 5) The neural network model corresponding to x* (x* is also located in the set X) is selected, the neural network model is trained through the training set A1, the accuracy y* of the trained neural network model on the test set A2 is taken as the model evaluation index, and step 3) is entered, that is, the next iteration process is entered.

[0165] In step 505, when the set stop condition is met, the optimal neural network model is output.

[0166] For example, the stop condition can be that the number of iterations reaches a number threshold, the time length of the iteration process reaches a time length threshold, or the difference between y* obtained by two consecutive iteration processes is less than a difference threshold. When the stop condition is met, the iteration process is stopped, and the neural network model with the highest model evaluation index (i.e., the optimal neural network model) is selected from all the neural network models whose model evaluation indexes have been determined, and is output, completing the search.

[0167] This application's embodiments systematically implement model search from three aspects: neural network model generation, dissimilarity measurement based on graph edit distance, and automatic neural network model search based on Bayesian optimization, achieving at least the following technical effects:

[0168] 1) Since neural network models can be represented as directed acyclic graphs, multiple neural network models with different structures can be generated randomly and quickly based on random graph models, thus realizing the rapid construction of the search space.

[0169] 2) In this embodiment of the application, an end-to-end graph edit distance model is trained using the GCN model and attention mechanism, which can calculate the graph edit distance more quickly and accurately compared with the traditional method.

[0170] 3) Based on graph edit distance and model evaluation metrics, combined with Bayesian optimization methods, the optimal neural network model can be found relatively efficiently. Compared with solutions provided by related technologies, the embodiments of this application have advantages in both search efficiency and the complexity of the obtained neural network model, namely, faster search efficiency and lower complexity of the final obtained neural network model, which is suitable for performing data tasks, such as computer vision tasks or natural language processing tasks.

[0171] 4) By automatically searching for neural network models, the time cost of manually designing model structures and manually adjusting weight parameters can be effectively reduced.

[0172] The following continues to describe the exemplary structure of the artificial intelligence-based model search device 455 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 2 As shown, the software modules stored in the AI-based model search device 455 in the memory 450 may include: a generation module 4551, used to generate multiple neural network models with different structures; a difference determination module 4552, used to take any one neural network model as a benchmark neural network model and determine the degree of difference between the benchmark neural network model and each neural network model; an iteration module 4553, used to perform the following iterative processing: fitting the functional relationship between the degree of difference and performance index of at least some neural network models, performing difference sampling processing on the function surrogate model obtained from the fitting processing, and using the neural network model corresponding to the degree of difference obtained from the difference sampling processing as the neural network model for the next round of iterative processing; and a task execution module 4554, used to execute a data task based on the neural network model with the highest performance index obtained from the iterative processing when the iterative processing stops.

[0173] In some embodiments, the function proxy model is a Gaussian process model; the iteration module 4553 is further configured to: perform prediction processing on each of the difference degrees by using the Gaussian process model, and perform fusion processing on the mean and the standard deviation of the performance indicators obtained through the prediction processing to obtain a sampling effect indicator of each of the difference degrees; and determine a difference degree with the highest sampling effect indicator from the plurality of difference degrees as the difference degree obtained through the difference degree sampling processing.

[0174] In some embodiments, the iteration module 4553 is further configured to: obtain an indicator difference by subtracting the highest performance indicator obtained through the iteration processing from the mean; obtain a first intermediate parameter by dividing the indicator difference by the standard deviation; obtain a first function value by performing processing on the first intermediate parameter by using a cumulative distribution function of the Gaussian process model; obtain a second function value by performing processing on the first intermediate parameter by using a probability density function of the Gaussian process model; and obtain the sampling effect indicator by performing weighted processing on the first function value and the second function value, with the indicator difference as a weight of the first function value and the standard deviation as a weight of the second function value.

[0175] In some embodiments, the iteration module 4553 is further configured to: obtain an indicator difference by subtracting the highest performance indicator obtained through the iteration processing from the mean; obtain a second intermediate parameter by subtracting a set trade-off parameter from the indicator difference and dividing the result by the standard deviation; and obtain the sampling effect indicator by performing processing on the second intermediate parameter by using a cumulative distribution function of the Gaussian process model.

[0176] In some embodiments, the iteration module 4553 is further configured to: perform any one of the following processing: obtain the sampling effect indicator by performing summation processing on the mean and the weighted standard deviation; and obtain the sampling effect indicator by subtracting the weighted standard deviation from the mean.

[0177] In some embodiments, the difference determination module 4552 is further configured to: map the baseline neural network model to a baseline structure graph and map the target neural network model to a target structure graph; determine a graph edit distance when converting the baseline structure graph to the target structure graph as the difference degree between the baseline neural network model and the target neural network model; and wherein the target neural network model is any one of the plurality of neural network models.

[0178] In some embodiments, the difference determination module 4552 is further configured to: perform feature extraction processing on the baseline structure graph and the target structure graph, and determine a difference feature between the features of the baseline structure graph and the features of the target structure graph; perform attention encoding processing on the difference feature; and perform full connection processing on the difference feature after the attention encoding processing to obtain the graph edit distance when converting the baseline structure graph to the target structure graph.

[0179] In some embodiments, the artificial intelligence based model searching apparatus 455 further comprises: a distance calculation module, configured to perform distance calculation processing on the sample source graph and the sample target graph by the first graph editing distance model to obtain a sample graph editing distance; a distance module training module, configured to train the second graph editing distance model according to the sample source graph, the sample target graph and the sample graph editing distance; wherein the processing complexity of the first graph editing distance model is greater than that of the second graph editing distance model; and the trained second graph editing distance model is configured to perform distance calculation processing on the reference structure graph and the target structure graph to obtain a graph editing distance when converting the reference structure graph into the target structure graph.

[0180] In some embodiments, the generating module 4551 is further configured to perform any one of the following processing: generating a plurality of neural network models with different structures according to a set number of neurons and a set number of edges of neuron connection; generating a plurality of neural network models with different structures according to a set number of neurons and a set probability of connection between each two neurons; and performing a plurality of rounds of genetic processing on the initial neural network model to obtain a plurality of neural network models with different structures; wherein each round of genetic processing comprises at least one of selection processing, crossover processing and mutation processing.

[0181] In some embodiments, the iteration module 4553 is further configured to: train the neural network model by using a training set of the data task; and determine a performance index of the trained neural network model by using a test set of the data task.

[0182] In some embodiments, the iteration module 4553 is further configured to: determine, from the plurality of trained neural network models obtained through the iteration processing, a trained neural network model with the highest performance index, and use the trained neural network model to perform the data task.

[0183] In some embodiments, the artificial intelligence based model searching apparatus 455 further comprises: a stopping module, configured to stop the iteration processing when one of the following conditions is met: the number of rounds of iteration processing that has been performed reaches a round threshold; the length of time of iteration processing that has been performed reaches a time threshold; and an index difference between performance indexes of two consecutive rounds of iteration processing is less than a difference threshold; wherein the performance index of the sample neural network model is a performance index of a sample neural network model; and the sample neural network model is a neural network model corresponding to a difference degree obtained through the difference degree sampling processing.

[0184] In some embodiments, the iteration module 4553 is further configured to: determine a performance index of a sample neural network model; wherein the sample neural network model is a neural network model corresponding to a difference degree obtained through the difference degree sampling processing; and use the sample neural network model and a plurality of neural network models with performance indexes as neural network models for the next round of iteration processing.

[0185] The embodiment of the present application provides a computer program product or computer program, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the model search method based on artificial intelligence provided by the embodiment of the present application.

[0186] The embodiment of the present application provides a computer readable storage medium storing executable instructions, wherein the executable instructions are stored, and when the executable instructions are executed by a processor, the processor will execute the method provided by the embodiment of the present application, for example, the model search method based on artificial intelligence as shown in Figure 3A 、 Figure 3B 、 Figure 3C 、 Figure 3D and Figure 6 .

[0187] In some embodiments, the computer readable storage medium can be FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disc, or CD-ROM, etc. memory; it can also be various devices including one or any combination of the above memories.

[0188] In some embodiments, the executable instructions can be in the form of programs, software, software modules, scripts or codes, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and can be deployed in any form, including being deployed as independent programs or being deployed as modules, components, subroutines or other units suitable for use in a computing environment.

[0189] As an example, the executable instructions can but not necessarily correspond to files in a file system, can be stored in part of a file storing other programs or data, for example, stored in one or more scripts in a hyper text markup language (HTML, Hyper Text Markup Language) document, stored in a single file dedicated to the program in question, or stored in multiple cooperative files (for example, files storing one or more modules, subroutines or code portions).

[0190] As an example, the executable instructions can be deployed to execute on one computing device, or on multiple computing devices located in one place, or on multiple computing devices distributed in multiple places and interconnected through a communication network.

[0191] The above merely illustrates the embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement and improvement made within the spirit and scope of the present application shall fall into the protection scope of the present application.

Claims

1. A model search method based on artificial intelligence, characterized in that, The method comprises: generating a plurality of neural network models with different structures; taking any one of the neural network models as a benchmark neural network model, and determining the difference degree between the benchmark neural network model and each of the neural network models; obtaining a data set of a data task, the data set comprising sample inputs and sample outputs; wherein the sample inputs are images, and the sample outputs are categories of the images; dividing the data set into a training set and a test set; training the neural network models through the training set; determining performance indicators of the trained neural network models through the test set; performing the following iterative processing: fitting a functional relationship between the difference degrees of at least part of the neural network models and the performance indicators, performing difference degree sampling processing according to a function proxy model obtained through the fitting processing, and taking a neural network model corresponding to a difference degree obtained through the difference degree sampling processing as a neural network model used for the next round of iterative processing; when the iterative processing stops, performing the data task according to a neural network model with the highest performance indicator obtained through the iterative processing.

2. The method of claim 1, wherein: the function proxy model is a Gaussian process model; the difference degree sampling processing according to the function proxy model obtained through the fitting processing comprises: performing prediction processing on any one of the difference degrees through the Gaussian process model, and performing fusion processing on a mean value and a standard deviation of performance indicators obtained through the prediction processing to obtain a sampling effect indicator of any one of the difference degrees; determining a difference degree with the highest sampling effect indicator among the plurality of difference degrees as the difference degree obtained through the difference degree sampling processing.

3. The method of claim 2, wherein, the fusion processing on the mean value and the standard deviation of the performance indicators obtained through the prediction processing to obtain the sampling effect indicator of any one of the difference degrees comprises: subtracting the highest performance indicator obtained through the iterative processing from the mean value to obtain an indicator difference; dividing the indicator difference by the standard deviation to obtain a first intermediate parameter; performing processing on the first intermediate parameter through a cumulative distribution function of the Gaussian process model to obtain a first function value; performing processing on the first intermediate parameter through a probability density function of the Gaussian process model to obtain a second function value; taking the indicator difference as a weight of the first function value and taking the standard deviation as a weight of the second function value to perform weighted processing on the first function value and the second function value to obtain the sampling effect indicator.

4. The method of claim 2, wherein, the fusion processing on the mean value and the standard deviation of the performance indicators obtained through the prediction processing to obtain the sampling effect indicator of any one of the difference degrees comprises: subtracting the highest performance indicator obtained through the iterative processing from the mean value to obtain an indicator difference; subtracting a set trade-off parameter from the indicator difference and dividing the result by the standard deviation to obtain a second intermediate parameter; performing processing on the second intermediate parameter through a cumulative distribution function of the Gaussian process model to obtain the sampling effect indicator.

5. The method of claim 2, wherein, The mean and the standard deviation of the performance indicators obtained by the prediction processing are fused to obtain a sampling effect indicator of any one of the difference degrees, including: Any one of the following processing is performed: The mean and the weighted standard deviation are summed to obtain a sampling effect indicator; The mean is subtracted from the weighted standard deviation to obtain a sampling effect indicator.

6. The method of claim 1, wherein, The difference degree between the baseline neural network model and each of the neural network models is determined, including: The baseline neural network model is mapped to a baseline structure graph, and the target neural network model is mapped to a target structure graph; The graph edit distance when converting the baseline structure graph to the target structure graph is determined as the difference degree between the baseline neural network model and the target neural network model; The target neural network model is any one of the plurality of neural network models.

7. The method of claim 6, wherein, The graph edit distance when converting the baseline structure graph to the target structure graph is determined, including: Feature extraction processing is performed on the baseline structure graph and the target structure graph, and the difference features between the features of the baseline structure graph and the features of the target structure graph are determined; Attention encoding processing is performed on the difference features; Fully connected processing is performed on the difference features after the attention encoding processing to obtain the graph edit distance when converting the baseline structure graph to the target structure graph.

8. The method of claim 6, wherein, The method further includes: A sample source graph and a sample target graph are subjected to distance calculation processing by a first graph edit distance model to obtain a sample graph edit distance; The second graph edit distance model is trained according to the sample source graph, the sample target graph, and the sample graph edit distance; The processing complexity of the first graph edit distance model is greater than that of the second graph edit distance model; the trained second graph edit distance model is used to perform distance calculation processing on the baseline structure graph and the target structure graph to obtain the graph edit distance when converting the baseline structure graph to the target structure graph.

9. The method according to any one of claims 1 to 8, characterized in that, The plurality of neural network models with different structures are generated, including: Any one of the following processing is performed: A plurality of neural network models with different structures are generated according to a set number of neurons and a set number of connection edges; A plurality of neural network models with different structures are generated according to a set number of neurons and a set probability of connection between each two neurons; An initial neural network model is subjected to multiple rounds of genetic processing to obtain a plurality of neural network models with different structures; each round of genetic processing includes at least one of selection processing, crossover processing, and mutation processing.

10. The method according to any one of claims 1 to 8, characterized in that, The neural network model with the highest performance indicator obtained by the iterative processing performs a data task, including: Among the plurality of trained neural network models obtained by the iterative processing, the trained neural network model with the highest performance indicator is determined to perform the data task.

11. The method according to any one of claims 1 to 8, characterized in that, The method further includes: The iterative processing is stopped when one of the following conditions is met: The number of rounds of the iterative processing that has been performed reaches a round threshold; The duration of the iterative processing that has been performed reaches a duration threshold; A difference between performance indicators of two consecutive rounds of the iterative processing is less than a difference threshold; The performance indicator of the sampling neural network model is a performance indicator of a sampling neural network model corresponding to the difference degree obtained by the difference degree sampling processing.

12. The method according to any one of claims 1 to 8, characterized in that, The neural network model corresponding to the difference degree obtained by the difference degree sampling processing is used as a neural network model for the next round of iterative processing, including: The performance indicator of the sampling neural network model is a performance indicator of a sampling neural network model corresponding to the difference degree obtained by the difference degree sampling processing. The sampling neural network model and other neural network models with performance indicators are used as neural network models for the next round of iterative processing. 13.A model search device based on artificial intelligence, characterized by, The apparatus includes: A generation module for generating a plurality of neural network models with different structures; A difference determination module for determining a difference degree between a reference neural network model and each of the neural network models; An iteration module for obtaining a data set of a data task, the data set including sample inputs and sample outputs; wherein the sample inputs are images, and the sample outputs are categories of the images; dividing the data set into a training set and a test set; training the neural network models through the training set; determining performance indicators of the trained neural network models through the test set; performing the following iterative processing: fitting a function relationship between the difference degrees of at least part of the neural network models and the performance indicators, performing difference degree sampling processing according to a function proxy model obtained by the fitting processing, and using a neural network model corresponding to a difference degree obtained by the difference degree sampling processing as a neural network model for the next round of iterative processing; A task execution module for executing the data task according to a neural network model with the highest performance indicator obtained by the iterative processing when the iterative processing stops.

14. An electronic device, comprising: It includes: A memory for storing executable instructions; A processor for executing the executable instructions stored in the memory to implement the model search method based on artificial intelligence according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that, Executable instructions are stored for being executed by a processor to implement the model search method based on artificial intelligence according to any one of claims 1 to 12.

16. A computer program product comprising computer instructions or a computer program, characterized in that, The computer instructions or computer programs are executed by the processor to implement the model search method based on artificial intelligence according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Neural network architecture searching method and device

    CN110276442A

  • Neural network model search method, image recognition method and device

    CN110555514A