Image recognition network construction method, device, equipment and medium

By introducing multi-layer network structure and search parameters into the image recognition network, the network module with superior performance is gradually determined and retained, and the problem of only searching shallow networks in the prior art is solved, and the search depth and accuracy of the image recognition network are improved sex.

CN112200223BActive Publication Date: 2024-11-08MEGVII (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011004261.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-22
Publication Date
2024-11-08
Estimated Expiration
2040-09-22

AI Technical Summary

Technical Problem

The existing SuperNet based neural network architecture search method can only search shallow networks and cannot effectively search for larger network structures, resulting in the image recognition network being not the best structure.

Method used

By creating an original neural network with a multi-layer network structure, each layer of network structure includes multiple network modules with search parameters, and during the training process, the target network module is determined based on the search parameters, and the network module with superior performance is gradually searched and retained, forming a Image recognition network.

Benefits of technology

It improves the depth and efficiency of network search, obtains higher image recognition accuracy, and ensures that the final image recognition network has higher recognition performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112200223B_ABST
    Figure CN112200223B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method, device, equipment and medium for constructing an image recognition network. The method includes: creating an original neural network, the original neural network includes a multi-layer network structure, each layer of the network structure includes multiple network modules with search parameters, and a residual branch is set between the input end and the output end of each layer of the network structure; using a first image sample set as a training sample, training the original neural network, and updating the parameters of the original neural network and the search parameters of the multiple network modules included in each layer of the network structure; in the process of training the original neural network, according to the search parameters of each network module included in each layer of the network structure, determining a target network module, the target network module being the network module with the largest current search parameter value among all network modules; when the training end condition is met, determining an image recognition network according to the multiple target network modules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to an image recognition network construction method, device, equipment and medium. Background Art

[0002] Deep learning technology is widely used in the field of computer vision due to its advantages of fast speed and high accuracy. For deep learning, the design of the neural network architecture is the most important factor that determines its effectiveness. Since the current development of deep learning theory is still imperfect, in order to design an ideal neural network architecture, it not only requires designers to have rich knowledge and in-depth understanding, but also requires a lot of exploratory experiments. This requires a lot of time, manpower and computing resources. In recent years, NAS (Neural Architecture Search) as a method for automatically designing network architecture has been applied to solve the above problems.

[0003] In the related art, in searching for image recognition networks for image recognition, the mainstream NAS algorithm is generally a neural network architecture search method based on SuperNet. This method constructs and trains a SuperNet covering all substructures in the search space to evaluate the substructures, thereby obtaining an image recognition network. Although this method has a faster search speed and better results, it can only search shallow networks, and this method occupies a large amount of video memory and cannot search for larger network structures, resulting in the searched image recognition network not being the optimal network structure. Summary of the invention

[0004] In view of the above problems, an image recognition network construction method, apparatus, system, device and medium are proposed in an embodiment of the present invention to overcome the above problems or at least partially solve the above problems.

[0005] In order to solve the above problems, the first aspect of the present invention discloses a method for constructing an image recognition network, the method comprising:

[0006] Creating an original neural network, wherein the original neural network includes a multi-layer network structure, each layer of the network structure includes a plurality of network modules with search parameters, and a residual branch is arranged between an input end and an output end of each layer of the network structure;

[0007] Using the first image sample set as training samples, training the original neural network, and updating the parameters of the original neural network and the search parameters of the multiple network modules included in each layer of the network structure;

[0008] In the process of training the original neural network, a target network module is determined according to the search parameters of each network module included in each layer of the network structure, wherein the target network module is the network module with the largest current search parameter value among all network modules;

[0009] When the training end condition is met, an image recognition network is determined based on the multiple target network modules.

[0010] Optionally, in the process of training the original neural network, determining the target network module according to the search parameters of each network module included in each layer of the network structure includes:

[0011] In the process of training the original neural network, the target network module is retained according to the current search parameters of each network module included in each layer of the network structure at every preset number of training times;

[0012] The current search parameters of the target network module are kept unchanged, the search parameters of the other network modules in the original neural network except the target network module are initialized, and the original neural network is continued to be trained.

[0013] Optionally, continuing to train the original neural network includes:

[0014] Except for the target layer network structure where the target network module is located, the network modules to be trained are determined from the remaining layers of network structures in the original neural network respectively;

[0015] The neural network composed of the target network module and the determined multiple network modules to be trained is trained.

[0016] Optionally, when the training end condition is met, determining the image recognition network according to the plurality of target network modules includes:

[0017] At the end of the training, other network modules in the original neural network except for the multiple target network modules are discarded to obtain an image recognition network composed of the multiple target network modules.

[0018] Optionally, updating the parameters of the original neural network and the search parameters of each of the plurality of network modules included in each layer of the network structure comprises:

[0019] After each training is completed, the search parameters of the multiple network modules included in each layer of the network structure during the training are kept unchanged, and the parameters of the original neural network are updated;

[0020] The updated parameters of the original neural network are kept unchanged, and the search parameters of the multiple network modules included in each layer of the network structure are updated.

[0021] Optionally, after determining the image recognition network according to the plurality of target network modules, the method further comprises:

[0022] The image recognition network is trained using the second image sample set as training samples to obtain an image recognition model for performing image recognition.

[0023] Optionally, each layer of the network structure includes a plurality of network modules whose internal structures are different from each other; and / or

[0024] The input ends of the multiple network modules included in each layer of network structure are respectively connected to the output ends of the previous layer of network structure, and the output ends of the multiple network modules included in each layer of network structure are respectively connected to the input ends of the next layer of network structure.

[0025] A second aspect of the embodiments of the present invention further discloses an image recognition network construction device, the device comprising:

[0026] An original neural network creation module, used to create an original neural network, wherein the original neural network includes a multi-layer network structure, each layer of the network structure includes a plurality of network modules with search parameters, and a residual branch is provided between the input end and the output end of each layer of the network structure;

[0027] A parameter updating module, used to train the original neural network using the first image sample set as training samples, and to update the parameters of the original neural network and the search parameters of each of the multiple network modules included in each layer of the network structure;

[0028] A screening module is used to determine a target network module according to the search parameters of each network module included in each layer of the network structure during the training of the original neural network, wherein the target network module is the network module with the largest current search parameter value among all network modules;

[0029] A determination module is used to determine the image recognition network according to the multiple target network modules when the training end condition is met.

[0030] According to a third aspect of the embodiments of the present invention, an electronic device is disclosed, including:

[0031] one or more processors; and

[0032] One or more machine-readable media having instructions stored thereon, when executed by the one or more processors, enable the device to execute the image recognition network construction method as described in the embodiment of the first aspect of the present invention.

[0033] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is disclosed, wherein a computer program stored in the medium enables a processor to execute the image recognition network construction method as described in the embodiment of the first aspect of the present invention.

[0034] The embodiments of the present invention include the following advantages:

[0035] In an embodiment of the present invention, the created original neural network may include a multi-layer network structure, each layer of the network structure includes a plurality of network modules, wherein each network module has a search parameter, and a residual branch is provided between the input end and the output end of each layer of the network structure. In the process of training the original neural network, the parameters of the original neural network and the respective search parameters of the plurality of network modules may be updated, and at the same time, the network module of the network module with the largest current search parameter value may be determined as the target network module according to the respective search parameters of the plurality of network modules, and then at the end of the training, the image recognition network may be determined according to the plurality of target network modules.

[0036] In the embodiment of the present invention, since the search for the target network module is gradually completed while the original neural network is being trained, that is, the search for the image recognition network can be completed, the network search efficiency is improved. Since each layer of the network structure has a residual branch, the depth to which the original neural network can be trained is increased, the search depth is improved, and a higher accuracy image recognition network can be searched. In addition, in the process of training the original neural network, the search parameters of each network module can be updated, and the target network module can be screened out according to the search parameters of each network module, so that each target network module retained as the image recognition network is a network module with better performance, thereby improving the accuracy of image recognition by the final image recognition network. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0038] Figure 1 is a flowchart of a method for constructing an image recognition network according to an embodiment of the present invention;

[0039] Figure 2 is a schematic diagram of the structure of an original neural network created by an embodiment of the present invention;

[0040] Figure 3 is a schematic diagram of the construction process of an image recognition network construction method according to an embodiment of the present invention;

[0041] Figure 4 In one embodiment of the present invention, Figure 2 A schematic diagram of the structure of the image recognition network searched out from the original neural network shown;

[0042] Figure 5 is a schematic diagram of a construction process of an image recognition network construction method according to another embodiment of the present invention;

[0043] Figure 6 It is a structural block diagram of an image recognition network construction device in one embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0045] In the related technology, the SuperNet-based method constructs and trains a SuperNet covering all substructures in the search space to evaluate the substructure. This method has a faster search speed and better results, but tends to search shallow networks and cannot achieve ideal results in searching network width and network depth, resulting in the searched neural network structure not being the optimal network structure.

[0046] In view of this, the inventors have improved the neural network architecture search method based on SuperNet: multiple parallel network modules are introduced for each layer of the network, and search parameters are added to all network modules in the entire network. By training SuperNet and searching the network architecture simultaneously, the search for network modules, network width and network depth in the neural network are integrated during the training of SuperNet, thereby automatically searching for the best image recognition network, so as to improve the search efficiency while increasing the search depth.

[0047] Below, a method for constructing an image recognition network according to an embodiment of the present invention is described in detail.

[0048] Reference Figure 1 , Figure 2 and Figure 3 As shown, Figure 1 A flowchart showing a method for constructing an image recognition network according to an embodiment is shown. Figure 2A schematic diagram of the structure of an original neural network created by the present application is shown. During the training process of the original neural network, an image recognition network is searched out from the original neural network. Figure 3 A schematic diagram of the construction process of the image recognition network construction method of the present application is shown, which aims to gradually search for target network modules during the training of the original neural network to obtain an image recognition network composed of the target network modules searched out at the end of training.

[0049] like Figure 1 As shown, the image recognition network construction method may specifically include the following steps:

[0050] Step 101: Create an original neural network, wherein the original neural network includes a multi-layer network structure, each layer of the network structure includes a plurality of network modules carrying search parameters, and a residual branch is set between the input end and the output end of each layer of the network structure.

[0051] The last layer of the original neural network is a fully connected layer, which can output the probability that the input image belongs to each category. Specifically, the category can be determined according to the image recognition task.

[0052] like Figure 2 As shown, the original neural network may include a multi-layer network structure, as shown in 101 to 10n in the figure, each layer of the network structure includes multiple network modules, wherein the residual branch set between the input end and the output end of each layer of the network structure can be used to directly output the input of the layer of network structure, and the last layer of the neural network is a fully connected layer FC. Each network module is accompanied by a search parameter, and the search parameter can be updated during the training of the original neural network.

[0053] In this embodiment, the search parameter of a network module can be used as a basis for retaining or discarding the network module, that is, in practice, the search parameter can reflect the importance of the network module to image recognition during the training process of the entire original neural network.

[0054] In some embodiments, the multiple network modules included in each layer of network structure are parallel to each other, that is, the input ends of the multiple network modules included in each layer of network structure are respectively connected to the output ends of the upper layer of network structure, and the output ends of the multiple network modules included in each layer of network structure are respectively connected to the input ends of the lower layer of network structure. In this way, the network modules of each layer of network structure are independent of each other.

[0055] As Figure 2For example, the input ends of the network modules a1 and a2 in the network structure 101 are both connected to the input input, and the output ends of the network modules a1 and a2 are both connected to the input end of the network structure 102 .

[0056] The internal structures of the multiple network modules included in each layer of the network structure may also be different from each other. For example, the internal structures of the network modules b1 to bm in the network structure 102 may be different from each other. The internal structure of the network module may refer to the internal parameters of the network module, the number of convolution kernels, and the size of the convolution kernels. Network modules with different internal structures mean that the method of processing feature maps may be different, and thus different feature maps may be obtained. In this way, the diversity of the internal structure of the original neural network can be improved, making it easier to search for a better image recognition network.

[0057] Of course, in the specific implementation, the internal structure of each network module can be set according to the needs, and the number of network modules included in each layer of network structure can also be determined according to the needs. Among them, the number of network modules included in different layers of network structure can be different or the same. For example, the number of network modules included in network structure 101 to network structure 10n can be different. In practice, the number of network modules can be determined according to the needs of training. This application does not strictly limit the number of network modules in each layer of network structure. However, under normal circumstances, in order to make the training more sufficient, the number of network modules in a layer of network structure will not be set too much.

[0058] Step 102: Using the first image sample set as training samples, the original neural network is trained, and the parameters of the original neural network and the search parameters of each of the multiple network modules included in each layer of the network structure are updated.

[0059] In this embodiment, the first image sample set may include multiple sample images for the same image recognition task, and each sample image may carry a label according to actual training requirements.

[0060] The image recognition task of the present invention may be a face image recognition task, an image classification task, an attribute recognition task, a fingerprint image recognition task, an iris image recognition task, etc. Accordingly, for the face image recognition task, the first image sample set may include multiple face images from different faces or the same face; for the attribute recognition task, the first image sample set may include multiple sample images with different attributes; for the fingerprint image recognition task, the first image sample set may include multiple fingerprint images from different fingers or the same finger; for the iris image recognition task, the first image sample set may include multiple iris images from different eyes or the same eye.

[0061] In this embodiment, for different image recognition tasks, the original neural network can be trained according to the corresponding model training method. The loss value of the original neural network is determined according to each training, and the parameters of the original neural network and the search parameters of the multiple network modules included in each layer of the network structure are updated according to the loss value.

[0062] Before training the original neural network, the search parameters of each network module in the original neural network can be set as initial parameters, that is, the search parameters of each network module are initialized. After that, in the process of training the original neural network, the search parameters of each network module can be updated according to the loss value of each training. The updated search parameters can reflect the importance of the network module in recognizing images in the multiple trainings that have been experienced. The larger the search parameter value, the greater the importance.

[0063] Step 103: During the training of the original neural network, a target network module is determined according to the search parameters of each network module included in each layer of the network structure. The target network module is the network module with the largest current search parameter value among all network modules.

[0064] In the process of training the original neural network, the target network module can be determined every N times according to the search parameters of each network module. In practice, after the target network module is determined, the search parameters of the target network module can be fixed, that is, in subsequent training, the search parameters of the target network module are no longer updated, so that the number of target network modules can be continuously increased during the training process.

[0065] In another example, when training the original neural network, the sub-neural network composed of some network modules in the original neural network can be trained, wherein the sub-neural networks targeted at different times can be different, that is, the sub-neural network targeted at the nth training can be different from the sub-neural network targeted at the mth training. The sub-neural network can refer to the network modules selected from each layer of the network structure, so that the network depth of the original neural network training can be reduced, thereby improving the training efficiency.

[0066] Among them, the network module targeted in each training can be randomly selected, or the probability of the optional network module in each layer of the network structure being sampled is calculated according to the size of the search parameter in the network structure, and the network module of this layer of the network structure is selected for sampling based on this probability.

[0067] In this embodiment, in the process of training the original neural network, the neural network composed of different network modules screened out from the original neural network can be trained, and at the end of each training, the search parameters can be updated. Then, the target network module can be determined according to the search parameters each time or multiple times, wherein the target network module selected and retained is the module with better performance searched out, and can be retained as the final image recognition network.

[0068] Specifically, the search parameters of the retained target network modules are network modules that meet certain parameter conditions, for example, network modules with the largest search parameter values, or network modules with search parameter values ​​reaching preset values, wherein the number of retained target network modules in each layer of the network structure may be different.

[0069] like Figure 3 As shown, Figure 3 -a is a schematic diagram of the initial training, Figure 3 -b is a schematic diagram of the nth training after the initial training. Figure 3 -c is a diagram of the last training. Figure 3 In the figure, the network modules in the solid line frame are the selected network modules that can be used for training. The input represents the input of the original neural network. The input passes through the training path indicated by the solid line arrows and finally becomes the output of this training. The sum of the feature map output by each layer of the network structure and the feature map input to the layer of the network structure is used as the input of the next layer of the network structure. Figure 3 As shown, the features Figure 1 is the output of network structure 101, and feature map j is the output and feature map of network structure 102. Figure 1 The feature map after the sum.

[0070] like Figure 3 -b and Figure 3 -c, as shown in Figure 3 -b and Figure 3 The network modules filled with gray in -c are the target network modules. It can be seen that with the increasing number of training times, the number of retained target network modules gradually increases. In this way, the search for network structure during training can be understood as a progressive growth search method, that is, the number of target network modules increases continuously during training until the end of training, when the optimal network structure (i.e., image recognition network) is obtained.

[0071] Step 104: When the training end condition is met, an image recognition network is determined based on the multiple target network modules.

[0072] In this embodiment, the training end condition may refer to the loss value during the training process being less than a preset threshold, or the number of training times reaching a preset number of times, or the recognition result meeting a preset recognition result, or the network structure size of the network formed by the target network module reaching the computational limit.

[0073] After the training is completed, in some examples, the target network module can be retained, while all network modules except the target network module in the network structure are discarded, and then the target network module and the residual branches and fully connected layers in the neural network constitute an image recognition network, in which the original connection relationship between the target network modules is retained.

[0074] Among them, the position of the network structure where the target network module retained in the image recognition network is located can remain unchanged. In practice, there may be a situation where there is no target network module in one or several layers of the network structure. In this case, the one or several layers of the network structure can be discarded. In this way, the number of layers of the network structure of the obtained image recognition network can be smaller than the number of layers of the network structure of the original neural network, that is, the network depth of the image recognition network can be smaller than the network depth of the original neural network.

[0075] The image recognition network obtained through search may not be sufficiently trained. In practice, in order to improve the efficiency of image recognition in subsequent use of the image recognition network, the image recognition network may be retrained or further fine-tuned.

[0076] In the implementation of the present invention, a plurality of retained network modules in the original neural network after the training is completed can constitute an image recognition network.

[0077] In some embodiments, during the training process, the determined target network modules can be marked, so that after the training is completed, the marked multiple target network modules, residual connections and the final connection layer can be determined as an image recognition network.

[0078] Reference Figure 4 As shown, it is shown in Figure 2 The schematic diagram of the structure of the image recognition network searched out from the original neural network shown in Figure 1. Figure 3 -The retained target network module in b is located in the network structure 102. In the image recognition network, the retained target network module b2 is also located in the network structure 102, and the residual branch of each layer of the network structure is also retained.

[0079] In the embodiment of the present invention, since search parameters are configured for each network module, during the process of training the original neural network, the search parameters of each network module can be updated while the parameters of the original neural network are updated. At the same time, each network can be retained or discarded according to the search parameters of each network module, thereby gradually searching for the best image recognition network during the process of training the original neural network, thereby improving the search efficiency.

[0080] Experiments show that, taking the image recognition task as an image classification task as an example, under the same computational load and computational delay constraints, the image recognition network searched using the method provided in this embodiment can obtain a higher image classification accuracy.

[0081] Reference Figure 3 As shown, in some embodiments, when retaining or discarding each network module included in each layer of the network structure according to the respective search parameters of each network module included in each layer of the network structure, the target network module can be retained according to the current search parameters of each network module included in each layer of the network structure every preset number of training times, and the target network module is the network module with the largest current search parameter value among all network modules.

[0082] In this embodiment, the search parameter of the retained target network module can be the network module with the largest search parameter value in the entire original neural network. In practice, if there are multiple network modules with the largest search parameter values, all of the multiple network modules can be retained.

[0083] Among them, the target network module can be retained once every preset number of training times. For example, when the target network module is retained once after every 5 rounds of training, assuming that the original neural network is trained a total of 100 rounds, the network module is retained once every 5 rounds, and the network module is retained for a total of 20 rounds.

[0084] Accordingly, in order to improve the search stability in the process of retaining the target network module according to the search parameters, that is, to reduce the variability of the search parameters of the retained network module in the subsequent training process, after each time the target network module is retained, the current search parameters of the target network module can be kept unchanged, and the search parameters of each network module other than the target network module in the original neural network can be initialized to continue training the original neural network.

[0085] by Figure 3-b as an example, at the end of the nth training, network module b2 is retained because of the largest search parameter, and the search parameter of network module b2 can be fixed or removed, so that in the subsequent training process, the search parameter of network module b2 is not updated, and the search parameters of other network modules in the original neural network are initialized, that is, the search parameters of these network modules can be set to the initial search parameter values ​​of each network module during the initial training. In the subsequent n+1th training, the search parameters of other network modules can be updated.

[0086] When the technical solution of this embodiment is adopted, the search parameters of each retained target network module can be fixed or removed. In this way, even if the target network module is used for training in a subsequent training process, its search parameters will no longer be updated, thereby ensuring the stability of the network structure search.

[0087] In some other embodiments, the retained target network module can still be used to participate in the subsequent training process, that is, the target network module determined in the nth training can participate in the n+1th training. In this way, the number of training times for the target network module can be increased, so that the image recognition performance of the retained network module is better.

[0088] Specifically, while retaining the target network module and continuing to train the original neural network, the network modules to be trained can be determined from the remaining network structures of each layer in the original neural network, except for the target layer network structure where the target network module is located; and the neural network composed of the target network module and the determined multiple network modules to be trained can be trained.

[0089] Specifically, after retaining the target network each time or multiple times, the sub-neural network composed of multiple network modules screened out from the original neural network can be trained, wherein the multiple network modules screened out for training may include the target network module and network modules to be trained except the target network module, and the network modules to be trained may be determined based on the search parameters of each network module except the target network module.

[0090] In a specific implementation, the probability of sampling the optional network modules in each layer of the network structure can be calculated according to the size of the search parameter in the network structure, and the network modules other than the target network module in the network structure can be sampled with this probability, and the sampled network modules can be determined as the modules to be trained for this training. Alternatively, multiple network modules to be trained can be randomly selected from the network modules other than the target network module in the network structure, and the randomly selected network modules to be trained can be used for this training.

[0091] like Figure 3 -a, Figure 3 -b and Figure 3 -c, Figure 3 -b is a schematic diagram at the end of the nth training. The retained target network module is b2. The network modules targeted at the n+1th training may include network module b2, and also include network modules selected from the remaining network modules except network module b2. It can be seen that during the training process, the trained network modules include the target network module and other network modules except the target network module. As the number of training times increases, the number of target network modules increases.

[0092] In some other embodiments, during the training process, when updating the parameters of the original neural network and the search parameters of the network module, the parameters of the multi-layer network structure and the search parameters of each network module may be updated alternately. Specifically, the alternate updating may be achieved in the following manner:

[0093] After each training is completed, the search parameters of the multiple network modules included in each layer of the network structure during the training are kept unchanged, and the parameters of the original neural network are updated; and the updated parameters of the original neural network are kept unchanged, and the search parameters of the multiple network modules included in each layer of the network structure are updated.

[0094] For example, after the nth training is completed, the current search parameters of each network module whose search parameters are to be updated can be kept unchanged, and the parameters of the original neural network are updated first. The network module whose search parameters are to be updated is a network module other than the retained network module. After that, after the update of the parameters of the original neural network is completed, the updated parameters of the original neural network can be kept unchanged, and then the search parameters of each network module whose search parameters are to be updated are updated.

[0095] In practice, after the image recognition network is obtained, the image recognition network can be used for image recognition. However, in some embodiments, in order to make the image recognition accuracy of the image recognition network higher, that is, to improve the recognition performance of the image recognition network, the image recognition network can also be continuously trained after the image recognition network is obtained.

[0096] Specifically, the image recognition network may be trained using the second image sample set as training samples to obtain an image recognition model for performing image recognition.

[0097] The image recognition task when training the image recognition network is the same as the image recognition task when training the original neural network. Thus, the second image sample set may be the same as the first image sample set, or the sample images in the second image sample set may be of the same image type as the sample images in the first image sample set.

[0098] For example, the image recognition task for training the original neural network is a face image recognition task, and the first image sample set includes multiple face images from different faces or the same face. Then, the image recognition task for training the image recognition network is also a face image recognition task, and the second image sample set includes multiple face images from different faces or the same face. Alternatively, the second image sample set may actually be the first image sample set, that is, the same image sample set is used to train the original neural network and the image recognition network.

[0099] Reference Figure 5 As shown, a schematic diagram of the construction process of an image recognition network construction method of another embodiment of the present application is shown. In this embodiment, the complete process may include the following steps:

[0100] Step 501: Create an original neural network, wherein the original neural network includes a multi-layer network structure, each layer of the network structure includes a plurality of network modules with search parameters, and a residual branch is set between the input end and the output end of each layer of the network structure.

[0101] The original neural network also includes a selected network module set S, and the set S is initialized to an empty set.

[0102] The process of step S501 is similar to the process of step S101 above, and will not be repeated here.

[0103] Step 502: Using the first image sample set as training samples, the original neural network is trained.

[0104] At the end of each training, the parameters of the original neural network and the search parameters of each of the multiple network modules included in each layer of the network structure are updated.

[0105] And in the process of training the original neural network, the target network module is determined according to the search parameters of each network module included in each layer of the network structure, and the target network module is the network module with the largest current search parameter value among all network modules.

[0106] In this embodiment, the network modules targeted for each training may be selected by random screening or by a combination of screening based on search parameters.

[0107] Among them, the process of searching for the image recognition network during the training process can be as follows Figure 5 As shown, the specific process is as follows:

[0108] Step S503-1, as Figure 5As shown, during the first training, the network modules to be trained can be randomly selected from each layer of the network structure of the original neural network to form the path of the initial training, such as Figure 5 As shown in the first training, the selected network modules are a3, b1 and c2, and the feature graph processing path during training is shown as the solid arrow in the figure, wherein the network module selected for each layer of the network structure can be one. At the end of the initial training, after updating the parameters of the original neural network, the search parameters of each network module included in each layer of the network structure are updated.

[0109] Step S503-2, performing a second training. During the second training, the network modules to be trained can be randomly selected from each layer of the original neural network structure according to the search parameters of each network module. Figure 5 The training path (a2-b3-c3) shown by the solid arrow during the second training, when the second training is finished, the parameters of the original neural network and the search parameters of each network module included in each layer of the network structure are updated.

[0110] Step S503-3, repeat the above step S503-2 until n trainings are completed. At this time, after the nth training is completed and the parameters of the original neural network and the search parameters of each network module included in each layer of the network structure are updated, the target network module with the largest search parameter is selected from the entire original neural network, and the target network module is added to the set S for retention. Figure 5 As shown, the network modules a2 and b1 at the end of the nth training are the target network modules retained in the set S.

[0111] Next, the search parameter of the target network module with the largest search parameter is fixed, and the search parameters of the remaining network modules are initialized. Since the search parameters of the remaining network modules are initialized, in this case, a random screening method can be adopted to randomly select the network module for the n+1th training from the remaining network modules. During the n+1th training, the selected network modules to be trained and the target network modules in the set S can be trained. Figure 5 As shown in the schematic diagram of the n+1th training, the solid arrow shows the training path ((a1, a2)-(b1, b3)-c2) during the n+1th training, wherein the network module a2 and the network module b1 are also used for the n+1th training.

[0112] Step S503-4, repeat the above step S503-3 until the training is completed, and the target network module in the set S can always participate in the subsequent training process, that is, the network module targeted at each training includes the target network module in the set S. Among them, the target network module with the largest search parameter value is added to the set S every n updates, and the search parameters of the network modules outside the set S can be initialized at the same time. When updating the search parameters of the network module, the search parameters of the target network module in the set S can be kept unchanged, and only the search parameters of the network modules outside the set S are updated.

[0113] Step 504: The original neural network after training is determined as an image recognition network.

[0114] In this embodiment, the above step S503-3 is repeatedly executed until the network structure size of the image recognition network corresponding to the target network module in the set S reaches the computational limit, and then the training can be stopped, that is, the training is ended. At this time, the residual connection between the target network module in the set S and the original neural network is retained, and the remaining network modules are discarded to obtain the image recognition network.

[0115] Furthermore, the image recognition network can be trained to obtain an image recognition model.

[0116] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0117] Based on the same inventive concept, the present invention also proposes an image recognition network construction device, referring to Figure 6 As shown, a schematic diagram of the structure of an image recognition network construction device is shown, and the device may specifically include the following modules:

[0118] The original neural network creation module 601 is used to create an original neural network, wherein the original neural network includes a multi-layer network structure, each layer of the network structure includes a plurality of network modules with search parameters, and a residual branch is set between the input end and the output end of each layer of the network structure;

[0119] A parameter updating module 602 is used to train the original neural network using the first image sample set as training samples, and to update the parameters of the original neural network and the search parameters of each of the multiple network modules included in each layer of the network structure;

[0120] A screening module 603 is used to determine a target network module according to the search parameters of each network module included in each layer of the network structure during the training of the original neural network, wherein the target network module is the network module with the largest current search parameter value among all network modules;

[0121] The determination module 604 is used to determine the image recognition network according to the multiple target network modules when the training end condition is met.

[0122] Optionally, the screening module 603 may specifically include the following units:

[0123] A retaining unit, used for retaining the target network module according to the current search parameters of each network module included in each layer of the network structure at every preset number of training times during the training of the original neural network;

[0124] The parameter processing unit is used to keep the current search parameters of the target network module unchanged, initialize the search parameters of the other network modules in the original neural network except the target network module, and continue to train the original neural network.

[0125] Optionally, the device may further include the following modules:

[0126] A screening module, used to determine the network modules to be trained from the remaining layers of network structures in the original neural network, except for the target layer network structure where the target network module is located;

[0127] The continuing training module is used to train the neural network composed of the target network module and the determined multiple network modules to be trained.

[0128] Optionally, the determination module 604 is specifically used to discard other network modules in the original neural network except the multiple target network modules at the end of training, so as to obtain an image recognition network composed of the multiple target network modules.

[0129] Optionally, the parameter updating module 602 may specifically include the following units:

[0130] A first updating unit is used to keep the search parameters of the multiple network modules included in each layer of the network structure during the training unchanged after each training is completed, and update the parameters of the original neural network;

[0131] The second updating unit is used to keep the updated parameters of the original neural network unchanged and update the search parameters of the multiple network modules included in each layer of the network structure.

[0132] Optionally, the device may further include the following modules:

[0133] The recognition network training module is used to train the image recognition network using the second image sample set as training samples to obtain an image recognition model for image recognition.

[0134] Optionally, each layer of the network structure includes a plurality of network modules whose internal structures are different from each other; and / or

[0135] The input ends of the multiple network modules included in each layer of network structure are respectively connected to the output ends of the previous layer of network structure, and the output ends of the multiple network modules included in each layer of network structure are respectively connected to the input ends of the next layer of network structure.

[0136] An embodiment of the present invention also provides an electronic device that can be used to execute an image recognition network construction method. The electronic device may include a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute the image recognition network construction method.

[0137] An embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program that enables a processor to execute the image recognition network construction method as described in the embodiment of the present invention.

[0138] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0139] It will be appreciated by those skilled in the art that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0140] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0141] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0142] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0143] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.

[0144] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0145] The above is a detailed introduction to the image recognition network construction method, device, equipment and storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for constructing an image recognition network, characterized in that: The method comprises: Creating an original neural network, wherein the original neural network includes a multi-layer network structure, each layer of the network structure includes a plurality of network modules with search parameters, and a residual branch is arranged between an input end and an output end of each layer of the network structure; Using the first image sample set as training samples, training the original neural network, and updating the parameters of the original neural network and the search parameters of the multiple network modules included in each layer of the network structure; In the process of training the original neural network, a target network module is determined according to the search parameters of each network module included in each layer of the network structure, wherein the target network module is the network module with the largest current search parameter value among all network modules; When the training end condition is met, determining an image recognition network according to the plurality of target network modules; Among them, updating the parameters of the original neural network and the respective search parameters of the multiple network modules included in each layer of the network structure includes: after each training is completed, keeping the respective search parameters of the multiple network modules included in each layer of the network structure during the training unchanged, and updating the parameters of the original neural network; keeping the updated parameters of the original neural network unchanged, and updating the respective search parameters of the multiple network modules included in each layer of the network structure.

2. The method according to claim 1, characterized in that In the During the training of the original neural network, the target network module is determined according to the search parameters of each network module included in each layer of the network structure, including: In the process of training the original neural network, the target network module is retained according to the current search parameters of each network module included in each layer of the network structure at every preset number of training times; The current search parameters of the target network module are kept unchanged, the search parameters of the other network modules in the original neural network except the target network module are initialized, and the original neural network is continued to be trained.

3. The method according to claim 2, characterized in that Continue to train the original neural network, including: Except for the target layer network structure where the target network module is located, the network modules to be trained are determined from the remaining layers of network structures in the original neural network respectively; The neural network composed of the target network module and the determined multiple network modules to be trained is trained.

4. The method according to any one of claims 1 to 3, characterized in that: When the training end condition is met, an image recognition network is determined according to the plurality of target network modules, including: At the end of the training, other network modules in the original neural network except for the multiple target network modules are discarded to obtain an image recognition network composed of the multiple target network modules.

5. The method according to any one of claims 1 to 4, characterized in that: After determining the image recognition network according to the plurality of target network modules, the method further includes: The image recognition network is trained using the second image sample set as training samples to obtain an image recognition model for performing image recognition.

6. The method according to any one of claims 1 to 5, characterized in that: The internal structures of the multiple network modules included in each layer of the network structure are different from each other; and / or The input ends of the multiple network modules included in each layer of network structure are respectively connected to the output ends of the previous layer of network structure, and the output ends of the multiple network modules included in each layer of network structure are respectively connected to the input ends of the next layer of network structure.

7. An image recognition network construction device, characterized in that: The device comprises: An original neural network creation module, used to create an original neural network, wherein the original neural network includes a multi-layer network structure, each layer of the network structure includes a plurality of network modules with search parameters, and a residual branch is provided between the input end and the output end of each layer of the network structure; A parameter updating module, used to train the original neural network using the first image sample set as training samples, and to update the parameters of the original neural network and the search parameters of each of the multiple network modules included in each layer of the network structure; A screening module is used to determine a target network module according to the search parameters of each network module included in each layer of the network structure during the training of the original neural network, wherein the target network module is the network module with the largest current search parameter value among all network modules; A determination module, used to determine the image recognition network according to the plurality of target network modules when the training end condition is met; Among them, the parameter updating module is specifically used for: after each training is completed, keeping the search parameters of the multiple network modules included in each layer of the network structure during the training unchanged, and updating the parameters of the original neural network; keeping the updated parameters of the original neural network unchanged, and updating the search parameters of the multiple network modules included in each layer of the network structure.

8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes, the method for constructing an image recognition network as described in any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium, characterized in that: The computer program stored therein enables the processor to execute the image recognition network construction method as described in any one of claims 1-6.