CN112200304B - Neural network searching method, device, electronic equipment and storage medium - Google Patents

Neural network searching method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112200304B
CN112200304B CN202011063065.2A CN202011063065A CN112200304B CN 112200304 B CN112200304 B CN 112200304B CN 202011063065 A CN202011063065 A CN 202011063065A CN 112200304 B CN112200304 B CN 112200304B
Authority
CN
China
Prior art keywords
neural network
output
network
searched
network node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011063065.2A
Other languages
Chinese (zh)
Other versions
CN112200304A (en
Inventor
黄涛
游山
王飞
钱晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sensetime Technology Development Co Ltd
Original Assignee
Beijing Sensetime Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sensetime Technology Development Co Ltd filed Critical Beijing Sensetime Technology Development Co Ltd
Priority to CN202011063065.2A priority Critical patent/CN112200304B/en
Publication of CN112200304A publication Critical patent/CN112200304A/en
Application granted granted Critical
Publication of CN112200304B publication Critical patent/CN112200304B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a neural network searching method and device, electronic equipment and a storage medium. The method and the device determine the topological structure of the neural network by utilizing the probability of the selected output combination, expand the search space for searching the topological structure of the neural network, and improve the diversity of the searched topological structure and the precision of the neural network. In addition, the neural network searching method and device based on the neural network overcome the defects that training of the network nodes and the edges in the front is more sufficient and training of the network nodes and the edges in the back is not sufficiently achieved due to the fact that the neural network is searched by the aid of the input edges of the network nodes, influences caused by differences of different network depth characteristics can be eliminated, the dominant problem of a shallow topological structure is avoided, and the searching quality of the topological structure is improved.

Description

Neural network searching method, device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of deep learning, and in particular, to a neural network search method and apparatus, an electronic device, and a storage medium.
Background
The automatic neural network search is a novel and practical problem in the deep learning field, and aims to overcome the defects of high cost and experience deviation caused by manual neural network design and obtain a neural network with better performance.
For the neural network, the selection of the topological structure is as important as the selection of the operator, however, the current automatic search method determines the selection of the network topological structure by directly utilizing the probability corresponding to the operator and the topology derivation rule of manual design, so that the network search space is substantially reduced, the diversity of the searched topological structure is caused to be deficient, and the neural network with more diversity and higher precision is difficult to further search.
Disclosure of Invention
The embodiment of the application at least provides a neural network searching method and device, so that a topological structure of a neural network is searched in a larger searching space, and the neural network with higher precision is generated.
In a first aspect, the present application provides a neural network searching method, including:
acquiring at least one network node in a neural network to be searched and an output edge connected with the network node; the network node represents a feature graph output by a network layer in the neural network to be searched, and the output edge connected with the network node represents the conversion relation of the feature graph corresponding to the network node as input data, converted and output to another network node connected with the output edge;
combining output edges connected with the network nodes to obtain at least one output combination, and determining a target output edge of the network node based on a first selection probability that the output combination is selected, wherein the output combination comprises at least one output edge of the network node;
and generating a target neural network corresponding to the neural network to be searched based on the determined target output edge of the network node in the neural network to be searched.
In this aspect, the topological structure of the neural network is determined by using the probability of the selected output combination, so that the search space for searching the topological structure of the neural network is expanded, the defects of small search space and poor diversity of the topological structure caused by directly using the probability of an operator to determine the topological structure of the neural network are avoided, and the diversity of the searched topological structure and the precision of the neural network are improved. In addition, the neural network searching is carried out by utilizing the output edges of the network nodes, so that the defects that the training of the network nodes and the edges at the front part is more sufficient and the training of the network nodes and the edges at the back part cannot be sufficiently carried out due to the fact that the neural network is searched by utilizing the input edges of the network nodes are overcome, the influence caused by the difference of different network depth characteristics can be eliminated, the dominant problem of a shallow topological structure is avoided, and the searching quality of the topological structure is improved.
In a possible embodiment, the determining a target output edge of the network node based on the first selection probability that the output combination is selected includes:
determining a first selection probability that the output combination is selected;
and taking the output edge in the output combination with the highest first selection probability as the target output edge of the network node.
According to the embodiment, the output edge in the output combination with the maximum first selection probability is used as the target output edge of the network node, so that the output edge with a better effect can be searched for the network node, and the quality of the searched topological structure can be improved.
In a possible embodiment, the determining a first selection probability that the output combination is selected includes:
determining a second selection probability of the output edges connected with the network nodes based on a first selection probability of each output combination to which the output edges connected with the network nodes belong, wherein the first selection probability comprises a probability function with a preset probability parameter as a variable;
training the neural network to be searched based on the output edges connected with the network nodes and the second selection probability of the output edges;
determining an optimized value of the preset probability parameter based on the trained neural network to be searched;
and determining a first selection probability corresponding to the output combination based on the optimized value of the preset probability parameter.
According to the implementation mode, the neural network to be searched is trained by utilizing the second selection probability constructed by the preset probability parameters to obtain the optimized value of the preset probability parameters, the optimized value of the preset probability parameters can accurately determine the first selection probability of the selected output combination, and the target output edge of the network node is determined by utilizing the first selection probability, so that the defects of small search space and insufficient diversity of the topological structure caused by directly determining the topological structure of the neural network by utilizing the probability of an operator are overcome.
In a possible implementation, the conversion relation of the output edge representation includes an operator function with a preset operator parameter as a variable;
the training of the neural network to be searched based on the output edges connected with the network nodes and the second selection probability of the output edges comprises the following steps:
training the neural network to be searched based on an operator function represented by the output edge connected with the network node and the second selection probability of the output edge;
determining an optimized value of a preset operator parameter corresponding to the output edge based on the trained neural network to be searched;
the generating a target neural network corresponding to the neural network to be searched based on the determined target output edge of the network node in the neural network to be searched comprises:
and generating a target neural network corresponding to the neural network to be searched based on the target output edges of the network nodes and the optimized value of the preset operator parameter corresponding to each target output edge.
According to the embodiment, the neural network to be searched is trained, the optimized value of the preset probability parameter is determined, and the optimized value of the preset operator parameter corresponding to the output edge is determined, so that the search of the topological structure and the operator can be completed in one search, the search efficiency of the neural network and the effectiveness of the searched neural network are improved, and the resources consumed by the neural network search are saved.
In a possible implementation manner, the training the neural network to be searched based on the output edge connected to the network node and the second selected probability corresponding to the output edge includes:
constructing a loss function based on the output edges connected with the network nodes and the second selection probability corresponding to the output edges, wherein the loss function comprises an invalid topology penalty item;
the invalid topology penalty item represents the probability that the neural network to be searched contains invalid network nodes, wherein the invalid network nodes comprise network nodes without precursor nodes in the network structure of the neural network to be searched;
and training the neural network to be searched by using the constructed loss function.
According to the embodiment, the invalid topology punishment item is constructed by utilizing the second selection probability corresponding to the output edge, the neural network training is carried out by utilizing the invalid topology punishment item, and the punishment can be carried out on the invalid topology structure, so that the invalid topology structure is removed in the searching process, and the effectiveness of the target neural network obtained by searching is improved.
In a possible embodiment, the first selection probability is determined by:
acquiring image sample data;
training the neural network to be searched by adopting the image sample data;
and determining a first selection probability corresponding to the output combination according to the trained neural network to be searched.
According to the embodiment, the neural network to be searched is trained by using the image sample data, and the obtained target neural network can accurately process the image.
In a possible implementation, the neural network searching method further includes:
inputting a face image to be recognized into the target neural network;
and the target neural network processes the face image and outputs object identity information corresponding to the face image.
According to the embodiment, the searched target nerves are utilized to perform face recognition, and a more accurate face recognition result, namely the object identity information, can be obtained.
In a possible implementation, the neural network searching method further includes:
inputting an image to be processed into the target neural network;
and the target neural network processes the image to be processed and outputs the position information of the target object in the image to be processed.
In this embodiment, the object tracking is performed using the searched target nerve, and more accurate position information of the object can be obtained.
In a second aspect, the present application provides a neural network searching apparatus, including:
the acquisition module is used for acquiring at least one network node in the neural network to be searched and an output edge connected with the network node; the network node represents a feature graph output by a network layer in the neural network to be searched, and the output edge connected with the network node represents the conversion relation of the feature graph corresponding to the network node as input data, converted and output to another network node connected with the output edge;
an output edge screening module, configured to combine output edges connected to the network nodes to obtain at least one output combination, and determine a target output edge of the network node based on a first selection probability that the output combination is selected, where the output combination includes the at least one output edge of the network node;
and the network generation module is used for generating a target neural network corresponding to the neural network to be searched based on the determined target output edge of the network node in the neural network to be searched.
In a third aspect, an embodiment of the present application provides an electronic device, including: the neural network searching method comprises a processor, a memory and a bus, wherein the memory stores machine readable instructions executable by the processor, the processor and the memory are communicated through the bus when an electronic device runs, and the machine readable instructions are executed by the processor to execute the steps of the neural network searching method.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the neural network searching method.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments and are incorporated in and constitute a part of the specification will be briefly described below, and the drawings illustrate the embodiments consistent with the present application and together with the description serve to explain the technical solutions of the present application. It is appreciated that the following drawings depict only certain embodiments of the application and are therefore not to be considered limiting of its scope, for those skilled in the art will be able to derive additional related drawings therefrom without the benefit of the inventive faculty.
FIG. 1 is a flow chart illustrating a neural network searching method provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of a network structure in an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a neural network searching apparatus provided in an embodiment of the present application;
fig. 4 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. The components of the embodiments of the present application, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The term "and/or" herein merely describes an associative relationship, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of a, B, and C, and may mean including any one or more elements selected from the group consisting of a, B, and C.
The application provides a neural network searching method and device, electronic equipment and a storage medium, the application determines the topological structure of the neural network by utilizing the probability of the selected output combination, enlarges the searching space for searching the topological structure of the neural network, avoids the defects of small searching space and poor diversity of the topological structure caused by directly determining the topological structure of the neural network by utilizing the probability of an operator, and improves the diversity of the searched topological structure and the precision of the neural network. In addition, the embodiment of the application utilizes the output edges of the network nodes to search the neural network, overcomes the defects that the training of the network nodes and the edges at the front part is more sufficient and the training of the network nodes and the edges at the back part cannot be sufficiently performed due to the fact that the input edges of the network nodes are utilized to search the neural network, can eliminate the influence caused by the difference of different network depth characteristics, avoids the dominance problem of a shallow topological structure, and improves the searching quality of the topological structure.
The following describes a neural network searching method, apparatus, electronic device, and storage medium disclosed in the present application with specific embodiments.
As shown in fig. 1, an embodiment of the present application discloses a neural network searching method, which can be applied to a server for automatically performing a neural network search. Specifically, the neural network searching method may include the steps of:
s110, acquiring at least one network node in a neural network to be searched and an output edge connected with the network node; the network nodes represent the feature graph output by the network layer in the neural network to be searched, and the output edges connected with the network nodes represent the conversion relation of the feature graph corresponding to the network nodes as input data, converted and output to the feature graph corresponding to another network node connected with the output edges.
Here, the output edge of the certain network node is connected to the next network node of the network node. As shown in fig. 2, network node 0 has three output edges, which are connected to network node 1, network node 2, and network node 3, respectively; the network node 1 has two output edges connected to the network node 2 and the network node 3, respectively; the network node 2 has an output edge connected to the network node 3.
The conversion relation comprises an operator for converting the characteristic diagram corresponding to the network node into the characteristic diagram corresponding to another network node connected through the output edge. The conversion relation further includes selection information of a network node at the end of the corresponding output edge, for example, one output edge connecting node 1 in fig. 2 is connected to node 2, and the corresponding conversion relation includes not only an operator for converting the feature graph corresponding to node 1 into the feature graph corresponding to node 2, but also selection information of a target node connecting node 1 among nodes 2 and 3 (i.e., node 2 is selected).
S120, combining the output edges connected with the network nodes to obtain at least one output combination, and determining a target output edge of the network node based on a first selection probability that the output combination is selected, wherein the output combination comprises at least one output edge of the network node.
The output combination may include one output edge connected to the corresponding network node, or may include at least two output edges connected to the corresponding network node, and the number of the output edges included in the output combination is not limited in the present application, so that the number of the target output edges of the corresponding network node determined according to the first selection probability may be any possible number, and the corresponding output combination may also be a combination of any number of any output edges, thereby increasing a search space of a topology structure, and being capable of searching for more various topology structures.
Here, the output edge in the output combination with the highest first selection probability may be specifically used as the target output edge of the network node.
The output edge in the output combination with the maximum first selection probability is used as the target output edge of the corresponding network node, so that the output edge which is more effective for improving the performance of the whole network structure can be searched for the network node, and the quality of the searched topological structure can be improved.
Before determining the target output edge of the network node, first, a first selection probability that the output combination is selected needs to be determined, and specifically, the first selection probability may be determined by using the following steps: firstly, determining a second selection probability of the output edge connected with the network node based on a first selection probability of each output combination to which the output edge connected with the network node belongs, wherein the first selection probability comprises a probability function with a preset probability parameter as a variable. Then, training the neural network to be searched based on the output edges connected with the network nodes and the second selection probability of the output edges; determining an optimized value of the preset probability parameter based on the trained neural network to be searched; and finally, determining a first selection probability corresponding to the output combination based on the optimized value of the preset probability parameter.
The second selection probability of the output edge connected to the network node is equal to the sum of the first selection probabilities corresponding to the output combination including the output edge, and is multiplied by a preset coefficient, as shown in the following formula:
Figure BDA0002712918440000081
in the formula (I), the compound is shown in the specification,
Figure BDA0002712918440000082
and representing a second selection probability that the output edge of the network node i is selected as the edge from the network node i to the network node j, wherein the output edge represents the conversion relation of the feature graph corresponding to the network node i after conversion and output to the feature graph corresponding to the back-driving network node j of the network node i. />
Figure BDA0002712918440000083
And the first selection probability is expressed by corresponding to an output combination formed by an output edge output from the network node i to the network node k and an output edge output from the network node i to the network node j. />
Figure BDA0002712918440000084
And the first selection probability is expressed by corresponding to an output combination formed by an output edge output from the network node i to the network node k and an output edge output from the network node i to the network node j. />
Figure BDA0002712918440000085
Representing the preset coefficients shown and N representing the number of network nodes.
Taking the example that an output combination includes two output edges, the first selection probability of a certain output combination can be expressed by the following formula:
Figure BDA0002712918440000086
wherein j represents a network node j; (m, n) represents an output combination of the network node j, the output combination including an output edge output from the network node j to the network node m and an output edge output from the network node j to the network node n; tau is j A set of output combinations representing network node j, including all output combinations of network node j; m 'and n' represent network nodes to which two output edges in the output combination of the network node j are connected; beta is a j (m,n) A preset probability parameter representing that the output combination (m, n) is selected; p is a radical of formula j (m,n) Representing a first choice probability that the output combination (m, n) is chosen.
In the above, the calculation formulas of the first selection probability and the second selection probability are described for the case where the output combination includes two output edges, and when the output combination includes any number of output edges, the first selection probability and the second selection probability may be calculated by using the following formulas:
Figure BDA0002712918440000087
Figure BDA0002712918440000088
in the formula, b i Representing an output combination of network node i comprising any number of output edges.
Figure BDA0002712918440000089
Represents the output combination b i Is selected, is selected>
Figure BDA00027129184400000810
A second selection probability representing that the output edge of network node i is selected as the edge from network node i to network node j, and->
Figure BDA0002712918440000091
Represents the output combination b i Predetermined probability parameters of the selected probability, b i ' denotes a combination of outputs of network node i, B i Represents a set of output combinations of network node i, N represents the number of network nodes, and j represents a back-driving node j of network node i.
According to the relationship between the second selection probability and the first selection probability and the probability function of the first selection probability, the second selection probability and the first selection probability both use the preset probability parameter as a variable, so that the neural network to be searched is trained and iteratively adjusted to the preset probability parameter based on the output edge connected with the network node and the second selection probability of the output edge, the optimized value of the preset probability parameter can be obtained, the second selection probability can also be obtained, and the first selection probability of the relevant output combination can be determined according to the obtained optimized value of the preset probability parameter.
Training the neural network to be searched by utilizing the second selection probability constructed by the preset probability parameters to obtain the optimized value of the preset probability parameters, wherein the optimized value of the preset probability parameters can accurately determine the first selection probability of the selected output combination, and the target output edge of the network node is determined by utilizing the first selection probability, so that the search space of the topological structure of the neural network can be expanded, and the structure of the searched neural network is optimized.
The target output edge of the network node is determined, i.e. the topology of the network node is determined.
And when the neural network to be searched is trained based on the output edges connected with the network nodes and the second selection probability of the output edges, the second selection probability is used as the weight of the corresponding output edges, a characteristic diagram represented by the network nodes is generated in a weighted summation mode according to the topological structure of the network, and then the neural network to be searched is trained by utilizing the characteristic diagram. Specifically, the output edge and the corresponding weight may be weighted and summed by using the following formula:
Figure BDA0002712918440000092
in the formula, x j A feature map representing a characterization of network node j,
Figure BDA0002712918440000093
represents a second selected probability corresponding to an output edge output by network node i to network node j, and->
Figure BDA0002712918440000094
And representing the operator function corresponding to the output edge from the network node i to the network node j.
S130, generating a target neural network corresponding to the neural network to be searched based on the determined target output edge of the network node in the neural network to be searched.
The conversion relation of the output edge representation also comprises an operator function taking a preset operator parameter as a variable; the operator function is the operator function of the network layer corresponding to the output edge.
The training of the neural network to be searched based on the output edge connected to the network node and the second selection probability of the output edge may be based on an operator function represented by the output edge connected to the network node and the second selection probability of the output edge. After training, not only the optimized value of the preset probability parameter but also the optimized value of the preset operator parameter are obtained, so that the optimized result of the operator function corresponding to the output edge, namely the operator corresponding to the output edge connected with the network node can be obtained.
The target neural network corresponding to the neural network to be searched is generated based on the determined target output edges of the network nodes in the neural network to be searched, and specifically, the target neural network corresponding to the neural network to be searched may be generated based on the target output edges of the network nodes and the optimized values of the preset operator parameters corresponding to each target output edge.
And determining the operator of the corresponding network layer according to the obtained optimized value of the preset operator parameter.
The method is characterized in that a neural network to be searched is trained, and the optimized value of the preset operator parameter corresponding to the output edge is determined while the optimized value of the preset probability parameter is determined, so that the search of a topological structure and an operator can be completed simultaneously in one search, the search efficiency of the neural network and the effectiveness of the searched neural network are improved, and the resources consumed by the neural network search are saved.
The neural network is searched, not only the topological structure of the neural network needs to be determined, but also operators of each network layer need to be determined, after the target output edges of each network node in the neural network to be searched are determined, the topological structure of the neural network to be searched can be determined according to the target output edges of each network node, and then the target neural network corresponding to the neural network to be searched can be generated by combining the operators corresponding to each network layer.
When the neural network to be searched is trained, the neural network to be searched is trained by utilizing the loss function. In order to solve the problem, when constructing the loss function, a penalty for the invalid topology needs to be added to the loss function to reduce the possibility of the invalid topology appearing in the target neural network obtained by searching. The invalid topology mentioned above refers in particular to a topology comprising network nodes without any input.
Specifically, a loss function may be constructed based on the output edge connected to the network node and the second selected probability corresponding to the output edge, where the loss function includes an invalid topology penalty term. And the invalid topology penalty item represents the probability that the neural network to be searched contains invalid network nodes.
The above invalid topology penalty term can be represented by the following formula:
Figure BDA0002712918440000111
in the formula, gamma (beta) represents an invalid topology penalty item, N represents the number of network nodes in the neural network to be searched, i represents the current network node, j represents the back-driving network node of the current network node, and B i Set of output combinations representing network node i, including all input combinations of network node i, b i Represents one output combination of the network nodes i,
Figure BDA0002712918440000112
and representing the first selection probability corresponding to the output combination of the network node i.
If a network node does not have any input edges connected to it, then the network node is invalid, as is the corresponding network fabric. The purpose of the invalid topology penalty term is to constrain such cases. Specifically, j denotes a network node that determines whether to be invalid, and i denotes all predecessor nodes of the network node j.
Figure BDA0002712918440000113
A first selection profile representing the maximum of all output combinations of the network node iAnd (4) rate. b i Representing an output combination of network nodes i, B i Representing a set of output combinations of network nodes i and N representing the number of network nodes. />
Figure BDA0002712918440000114
Representing the maximum first choice probability corresponding to the output combination of all network nodes i and j with edge connection. If->
Figure BDA0002712918440000115
And &>
Figure BDA0002712918440000116
Equal, it means that in the final network structure, there is an edge connection between network node i and network node j. Then->
Figure BDA0002712918440000117
If not equal, then>
Figure BDA0002712918440000118
Figure BDA0002712918440000119
Is a positive value.
Figure BDA00027129184400001110
The purpose of multiplication is that, for all the predecessor nodes of the network node j, as long as there is an edge connection between the network node i and the network node j, the node of the network node j is valid, and then the whole equation, that is, the invalid topology penalty term value is 0. And if all the network nodes i are not connected with the network node j, the node j is invalid, and the value of the invalid topology penalty item is a positive value. A positive loss is penalized by the network optimization, and a value of 0 will not affect the network.
The outermost layer accumulation of the invalid topology penalty items is to add the topology conditions of all the network nodes, if the sum is 0, the network structure is effective, and if the sum is not 0, the network topology structure which is not 0 is punished.
Since the first selection probability and the second selection probability both use the preset probability parameter as a variable, the first selection probability in the above formula can be expressed by an equivalent function including the second selection probability, and therefore, a loss function including an invalid topology penalty term can be constructed based on the output edge connected to the network node and the second selection probability corresponding to the output edge.
And constructing an invalid topology punishment item by using the second selection probability corresponding to the output edge, and carrying out neural network training by using the invalid topology punishment item, so that the punishment can be carried out on an invalid topology structure, and the invalid topology structure in the target neural network obtained by searching is avoided.
When the neural network is searched, the number of network nodes included in the neural network can be set according to the requirement on the processing speed of the neural network and/or the information such as the bearing capacity of the device to which the neural network is deployed, so that the target neural network suitable for the specific scene requirement is obtained.
In some embodiments, the first choice probability is determined by: acquiring image sample data; training the neural network to be searched by adopting the image sample data; and determining a first selection probability corresponding to the output combination according to the trained neural network to be searched.
And training the neural network to be searched by using the image sample data, and accurately processing the image by using the obtained target neural network. In addition, because the image processing relates to a large number of matrix operations, the neural network has good processing capacity on the matrix operations, the image data is used as a sample for training, and the topological structure of the target neural network is searched, so that the neural network structure with good processing capacity on the image can be effectively searched, and the performance of the searched neural network structure in the image processing task is improved.
The target neural network obtained by searching is high in precision, and can well complete tasks such as face recognition, target tracking and image classification.
For example, face recognition can be achieved using the following steps:
inputting a face image to be recognized into the target neural network; and the target neural network processes the face image and outputs object identity information corresponding to the face image.
For another example, target tracking may be achieved using the following steps:
inputting an image to be processed into the target neural network; and the target neural network processes the image to be processed and outputs the position information of the target object in the image to be processed. .
When searching for the neural network to be searched, the method in the above embodiment may be used to search for the topological structure and the operator corresponding to each network node in the neural network to be searched, or the neural network to be searched may be first divided into a plurality of search units, then the method in the above embodiment is used to search for the topological structure and the operator corresponding to each network node in each search unit, and then the search units after the search are spliced together to obtain the target neural network.
Corresponding to the neural network searching method, the application also discloses a neural network searching device, which is applied to a server, and each module in the device can realize each step in the neural network searching of each embodiment and can obtain the same beneficial effect, so that the description of the same part is omitted. Specifically, as shown in fig. 3, the neural network searching apparatus includes:
an obtaining module 310, configured to obtain at least one network node in a neural network to be searched and an output edge connected to the network node; the network nodes represent feature graphs output by a network layer in the neural network to be searched, and the output edges connected with the network nodes represent conversion relations of feature graphs corresponding to another network node connected with the output edges, wherein the feature graphs corresponding to the network nodes are used as input data and are converted and output to the feature graphs corresponding to the other network node connected with the output edges.
An output edge screening module 320, configured to combine output edges connected to the network nodes to obtain at least one output combination, and determine a target output edge of the network node based on a first selection probability that the output combination is selected, where the output combination includes the at least one output edge of the network node.
The network generating module 330 generates a target neural network corresponding to the neural network to be searched based on the determined target output edges of the network nodes in the neural network to be searched.
In some embodiments, the output edge filtering module 320, when determining the target output edge of the network node based on the first selection probability that the output combination is selected, is configured to:
determining a first selection probability that the output combination is selected;
and taking the output edge in the output combination with the highest first selection probability as the target output edge of the network node.
In some embodiments, the output edge filtering module 320, when determining the first choice probability that the output combination is chosen, is configured to:
determining a second selection probability of the output edges connected with the network nodes based on a first selection probability of each output combination to which the output edges connected with the network nodes belong, wherein the first selection probability comprises a probability function with a preset probability parameter as a variable;
training the neural network to be searched based on the output edges connected with the network nodes and the second selection probability of the output edges;
determining an optimized value of the preset probability parameter based on the trained neural network to be searched;
and determining a first selection probability corresponding to the output combination based on the optimized value of the preset probability parameter.
In some embodiments, the transformation relation of the output edge representation comprises an operator function with a preset operator parameter as a variable;
the output edge screening module 320 is configured to, when training the neural network to be searched based on the output edge connected to the network node and the second selection probability of the output edge:
training the neural network to be searched based on an operator function represented by the output edge connected with the network node and the second selection probability of the output edge;
determining an optimized value of a preset operator parameter corresponding to the output edge based on the trained neural network to be searched;
the generating a target neural network corresponding to the neural network to be searched based on the determined target output edge of the network node in the neural network to be searched comprises:
and generating a target neural network corresponding to the neural network to be searched based on the target output edges of the network nodes and the optimized value of the preset operator parameter corresponding to each target output edge.
In some embodiments, the output edge filtering module 320, when training the neural network to be searched based on the output edges connected to the network nodes and the second selection probability corresponding to the output edges, is configured to:
constructing a loss function based on the output edges connected with the network nodes and the second selection probability corresponding to the output edges, wherein the loss function comprises an invalid topology penalty item;
the invalid topology penalty item represents the probability that the neural network to be searched contains invalid network nodes, wherein the invalid network nodes comprise network nodes without precursor nodes in the network structure of the neural network to be searched;
and training the neural network to be searched by using the constructed loss function.
In some embodiments, the output edge filtering module 320 determines the first selection probability by the following method;
acquiring image sample data;
training the neural network to be searched by adopting the image sample data;
and determining a first selection probability corresponding to the output combination according to the trained neural network to be searched.
In some embodiments, the apparatus further comprises a face recognition module 340 configured to:
inputting a face image to be recognized into the target neural network;
and the target neural network processes the face image and outputs object identity information corresponding to the face image.
In some embodiments, the apparatus further comprises a tracking module 350 for:
inputting an image to be processed into the target neural network;
and the target neural network processes the image to be processed and outputs the position information of the target object in the image to be processed.
Corresponding to the neural network searching method, an embodiment of the present application further provides an electronic device 400, as shown in fig. 4, a schematic structural diagram of the electronic device 400 provided in the embodiment of the present application includes:
a processor 41, a memory 42, and a bus 43; the memory 42 is used for storing execution instructions and includes a memory 421 and an external memory 422; the memory 421 is also referred to as an internal memory, and is used for temporarily storing the operation data in the processor 41 and the data exchanged with the external memory 422 such as a hard disk, the processor 41 exchanges data with the external memory 422 through the memory 421, and when the electronic device 400 operates, the processor 41 communicates with the memory 42 through the bus 43, so that the processor 41 executes the following instructions: acquiring at least one network node in a neural network to be searched and an output edge connected with the network node; the network node represents a feature graph output by a network layer in the neural network to be searched, and the output edge connected with the network node represents the conversion relation of the feature graph corresponding to the network node as input data, converted and output to another network node connected with the output edge; combining output edges connected with the network nodes to obtain at least one output combination, and determining a target output edge of the network node based on a first selection probability that the output combination is selected, wherein the output combination comprises at least one output edge of the network node; and generating a target neural network corresponding to the neural network to be searched based on the determined target output edge of the network node in the neural network to be searched.
The present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the neural network searching method in the foregoing method embodiments. The storage medium may be a volatile or non-volatile computer-readable storage medium.
The computer program product of the neural network searching method provided in the embodiment of the present application includes a computer readable storage medium storing a program code, where instructions included in the program code may be used to execute the steps of the neural network searching method described in the foregoing method embodiment, which may be specifically referred to the foregoing method embodiment, and are not described herein again.
The embodiments of the present application also provide a computer program, which when executed by a processor implements any one of the methods of the foregoing embodiments. The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above-mentioned embodiments are only specific embodiments of the present application, and are used for illustrating the technical solutions of the present application, but not limiting the same, and the scope of the present application is not limited thereto, and although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope disclosed in the present application; such modifications, changes or substitutions do not depart from the spirit and scope of the exemplary embodiments of the present application, and are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A neural network searching method, comprising:
acquiring at least one network node in a neural network to be searched and an output edge connected with the network node; the network node represents a feature graph output by a network layer in the neural network to be searched, and the output edge connected with the network node represents the conversion relation of the feature graph corresponding to the network node as input data, converted and output to another network node connected with the output edge;
combining output edges connected with the network nodes to obtain at least one output combination, and determining a target output edge of the network node based on a first selection probability that the output combination is selected, wherein the output combination comprises at least one output edge of the network node;
generating a target neural network corresponding to the neural network to be searched based on the determined target output edge of the network node in the neural network to be searched;
wherein the first selection probability is determined by: acquiring image sample data; training the neural network to be searched by adopting the image sample data; and determining a first selection probability corresponding to the output combination according to the trained neural network to be searched.
2. The neural network searching method of claim 1, wherein determining the target output edge of the network node based on the first selection probability that the output combination is selected comprises:
determining a first selection probability that the output combination is selected;
and taking the output edge in the output combination with the highest first selection probability as the target output edge of the network node.
3. The neural network searching method of claim 2, wherein the determining a first selection probability that the output combination is selected comprises:
determining a second selection probability of the output edges connected with the network nodes based on a first selection probability of each output combination to which the output edges connected with the network nodes belong, wherein the first selection probability comprises a probability function with a preset probability parameter as a variable;
training the neural network to be searched based on the output edges connected with the network nodes and the second selection probability of the output edges;
determining an optimized value of the preset probability parameter based on the trained neural network to be searched;
and determining a first selection probability corresponding to the output combination based on the optimized value of the preset probability parameter.
4. The neural network searching method of claim 3, wherein the conversion relation of the output edge representation includes an operator function with a preset operator parameter as a variable;
the training of the neural network to be searched based on the output edge connected with the network node and the second selection probability of the output edge comprises the following steps:
training the neural network to be searched based on an operator function represented by the output edge connected with the network node and the second selection probability of the output edge;
determining an optimized value of a preset operator parameter corresponding to the output edge based on the trained neural network to be searched;
the generating a target neural network corresponding to the neural network to be searched based on the determined target output edge of the network node in the neural network to be searched comprises:
and generating a target neural network corresponding to the neural network to be searched based on the target output edges of the network nodes and the optimized value of the preset operator parameter corresponding to each target output edge.
5. The neural network searching method according to claim 3 or 4, wherein the training of the neural network to be searched based on the output edges of the network node connection and the second selection probability corresponding to the output edges comprises:
constructing a loss function based on the output edges connected with the network nodes and the second selection probability corresponding to the output edges, wherein the loss function comprises an invalid topology penalty item;
the invalid topology penalty item represents the probability that the neural network to be searched contains invalid network nodes, wherein the invalid network nodes comprise network nodes without precursor nodes in the network structure of the neural network to be searched;
and training the neural network to be searched by using the constructed loss function.
6. The neural network searching method according to any one of claims 1 to 5, further comprising:
inputting a face image to be recognized into the target neural network;
and the target neural network processes the face image and outputs object identity information corresponding to the face image.
7. The neural network searching method according to any one of claims 1 to 5, further comprising:
inputting an image to be processed into the target neural network;
and the target neural network processes the image to be processed and outputs the position information of the target object in the image to be processed.
8. A neural network searching apparatus, comprising:
the device comprises an acquisition module, a search module and a search module, wherein the acquisition module is used for acquiring at least one network node in a neural network to be searched and an output edge connected with the network node; the network node represents a feature graph output by a network layer in the neural network to be searched, and the output edge connected with the network node represents the conversion relation of the feature graph corresponding to the network node as input data, converted and output to another network node connected with the output edge;
an output edge screening module, configured to combine output edges connected to the network nodes to obtain at least one output combination, and determine a target output edge of the network node based on a first selection probability that the output combination is selected, where the output combination includes the at least one output edge of the network node;
the network generation module is used for generating a target neural network corresponding to the neural network to be searched based on the determined target output edge of the network node in the neural network to be searched;
the output edge screening module determines a first selection probability by the following method; acquiring image sample data; training the neural network to be searched by adopting the image sample data; and determining a first selection probability corresponding to the output combination according to the trained neural network to be searched.
9. An electronic device, comprising: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating over the bus when the electronic device is operating, the machine-readable instructions when executed by the processor performing the steps of the neural network searching method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the neural network searching method according to any one of claims 1 to 7.
CN202011063065.2A 2020-09-30 2020-09-30 Neural network searching method, device, electronic equipment and storage medium Active CN112200304B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011063065.2A CN112200304B (en) 2020-09-30 2020-09-30 Neural network searching method, device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011063065.2A CN112200304B (en) 2020-09-30 2020-09-30 Neural network searching method, device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112200304A CN112200304A (en) 2021-01-08
CN112200304B true CN112200304B (en) 2023-03-24

Family

ID=74013544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011063065.2A Active CN112200304B (en) 2020-09-30 2020-09-30 Neural network searching method, device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112200304B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113869501B (en) * 2021-10-19 2024-06-18 京东科技信息技术有限公司 Neural network generation method and device, electronic equipment and storage medium
CN116431421B (en) * 2023-06-13 2023-08-29 成都登临科技有限公司 Neural network generation method and generator, verification method and system and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018215665A1 (en) * 2017-05-26 2018-11-29 Deepmind Technologies Limited Training action selection neural networks using look-ahead search
CN111406263A (en) * 2018-11-28 2020-07-10 深圳市大疆创新科技有限公司 Method and device for searching neural network architecture
CN111612134B (en) * 2020-05-20 2024-04-12 鼎富智能科技有限公司 Neural network structure searching method and device, electronic equipment and storage medium
CN111553480B (en) * 2020-07-10 2021-01-01 腾讯科技(深圳)有限公司 Image data processing method and device, computer readable medium and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于节点排序的贝叶斯网络结构学习算法;姚洁等;《计算机工程》;20170515(第05期);全文 *

Also Published As

Publication number Publication date
CN112200304A (en) 2021-01-08

Similar Documents

Publication Publication Date Title
CN112200304B (en) Neural network searching method, device, electronic equipment and storage medium
CN110532414B (en) Picture retrieval method and device
CN103838803A (en) Social network community discovery method based on node Jaccard similarity
CN115660078A (en) Distributed computing method, system, storage medium and electronic equipment
CN110414569B (en) Clustering implementation method and device
US10161269B2 (en) Output efficiency optimization in production systems
CN113902131B (en) Updating method of node model for resisting discrimination propagation in federal learning
CN111260056B (en) Network model distillation method and device
CN114610910A (en) Group perception-oriented teacher-student group privacy protection method and system
JP2017068577A (en) Arithmetic unit, method and program
CN111275625B (en) Image deblurring method and device and electronic equipment
CN109952742B (en) Graph structure processing method, system, network device and storage medium
CN111985624A (en) Neural network training and deploying method, text translation method and related products
CN109728958B (en) Network node trust prediction method, device, equipment and medium
CN112100452A (en) Data processing method, device, equipment and computer readable storage medium
CN107784363B (en) Data processing method, device and system
CN113936173A (en) Image classification method, device, medium and system for maximizing mutual information
CN112257977B (en) Logistics project construction period optimization method and system with resource limitation under fuzzy man-hour
US11388187B2 (en) Method of digital signal feature extraction comprising multiscale analysis
CN111985644A (en) Neural network generation method and device, electronic device and storage medium
Mei et al. Signal processing on graphs: Performance of graph structure estimation
CN113360218A (en) Service scheme selection method, device, equipment and storage medium
CN113036762A (en) SSA algorithm-based multi-channel power signal mode rapid identification method
CN113780526B (en) Face recognition network training method, electronic equipment and storage medium
CN113516583B (en) Oracle individual character style migration method and device based on generation-antagonism network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant