Structure search method and device for neural network model
Through the structure search method of the neural network model, the problem of poor processing effect of existing models on YUV data is solved, and the automatic construction of a model structure suitable for YUV data is realized, which improves the processing efficiency and effect.
Patent Information
- Application Number
- CN202010116705.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-25
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-02-25
AI Technical Summary
Existing neural network models are mainly designed for data in RGB format, and are difficult to effectively process image or video data in YUV format, resulting in poor processing results.
Through the structure search method of the neural network model, the controller is used to search for candidate network structures suitable for YUV image data from the preset network structure search space, obtain YUV image training data for training, and update the controller according to the performance information until convergence is achieved Conditions to generate a neural network model structure for YUV image data.
It realizes the automatic search for neural network model structure suitable for processing YUV image data, improves the model's processing ability of YUV data, reduces data conversion delay, and improves processing efficiency.
Smart Images

Figure CN111353585B
Abstract
Description
Technical Field
[0001] The embodiments disclosed herein relate to the field of computer technology, specifically to the field of artificial intelligence technology, and more particularly to a method and apparatus for structure search of neural network models. Background Technology
[0002] With the development of artificial intelligence technology, deep neural networks have achieved significant results in many fields. Deep neural networks possess unparalleled advantages over traditional data processing techniques in processing large volumes of diverse data. For example, in image data processing, trained deep neural networks can handle images of various resolutions, sizes, and sharpnesses across a wide range of scenes.
[0003] Existing neural network models for image or video processing are designed for RGB (red, yellow, and blue) input data. However, in some common image or video applications, the acquired data is in YUV (a luminance-chrominance color encoding) format. Because the physical meanings of YUV and RGB data differ significantly, neural network models designed for RGB data struggle to achieve good processing results with YUV data. Summary of the Invention
[0004] Embodiments of this disclosure provide methods and apparatus for structure search of neural network models, electronic devices, and computer-readable media.
[0005] In a first aspect, embodiments of this disclosure provide a method for searching the structure of a neural network model, comprising: using a controller to search for candidate network structures from a preset network structure search space; acquiring YUV image training data and training candidate network structures using the YUV image training data; acquiring performance information of the trained candidate network structures, generating feedback information based on the performance information of the trained candidate network structures, and feeding the feedback information back to the controller so that the controller updates based on the feedback information and searches for new candidate network structures from the preset network structure search space; and in response to determining that the feedback information generated based on the performance information of the currently trained candidate network structures has reached a preset convergence condition, generating a neural network model structure for YUV image data based on the currently trained candidate network structures.
[0006] In some embodiments, the preset network structure search space includes candidate sizes of the image; and the method further includes: using a controller to determine the image size corresponding to the candidate network structure from the candidate sizes of the image.
[0007] In some embodiments, the method further includes: in response to determining that the feedback information generated based on the performance information of the candidate network structure that has been trained has reached a preset convergence condition, determining the image size corresponding to the currently determined candidate network structure as the target image size corresponding to the neural network model structure for YUV image data.
[0008] In some embodiments, the above method further includes: acquiring YUV image data to be processed; converting the size of the YUV image data to be processed into the target image size and then inputting it into a neural network model structure for processing the YUV image data.
[0009] In some embodiments, the above-mentioned acquisition of YUV image training data includes: converting the acquired RGB image sample data into YUV image sample data, and converting the image size of the YUV image sample data into the image size corresponding to the candidate network structure determined from the preset network structure search space.
[0010] Secondly, embodiments of this disclosure provide a neural network model structure search apparatus, comprising: a first search unit configured to use a controller to search for candidate network structures from a preset network structure search space; a training unit configured to acquire YUV image training data and train candidate network structures using the YUV image training data; a feedback unit configured to acquire performance information of the trained candidate network structures, generate feedback information based on the performance information of the trained candidate network structures, and feed the feedback information back to the controller so that the controller updates based on the feedback information and searches for new candidate network structures from the preset network structure search space; and a generation unit configured to, in response to determining that the feedback information generated based on the performance information of the currently trained candidate network structures has reached a preset convergence condition, generate a neural network model structure for YUV image data based on the currently trained candidate network structures.
[0011] In some embodiments, the preset network structure search space includes candidate sizes of the image; and the apparatus further includes a second search unit configured to use a controller to determine the image size corresponding to the candidate network structure from the candidate sizes of the image.
[0012] In some embodiments, the generation unit is further configured to, in response to the determination that the feedback information generated based on the performance information of the candidate network structure that has been trained has reached a preset convergence condition, determine the image size corresponding to the currently determined candidate network structure as the target image size corresponding to the neural network model structure for YUV image data.
[0013] In some embodiments, the above apparatus further includes a processing unit configured to: acquire YUV image data to be processed; convert the size of the YUV image data to be processed into the target image size and then input it into a neural network model structure for processing the YUV image data.
[0014] In some embodiments, the training unit is configured to acquire YUV image training data in the following manner: converting the acquired RGB image sample data into YUV image sample data, and converting the image size of the YUV image sample data into the image size corresponding to the candidate network structure determined from the preset network structure search space.
[0015] Thirdly, embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the structure search method for the neural network model as provided in the first aspect.
[0016] Fourthly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the structure search method for the neural network model provided in the first aspect.
[0017] The neural network model structure search method and apparatus of the above embodiments of this disclosure employ a controller to search for candidate network structures from a preset network structure search space, then acquire YUV image training data, train the candidate network structures using the YUV image training data, acquire the performance information of the trained candidate network structures, generate feedback information based on the performance information of the trained candidate network structures, and feed the feedback information back to the controller. The controller updates itself based on the feedback information and then searches for new candidate network structures from the preset network structure search space. In response to determining that the feedback information generated based on the performance information of the currently trained candidate network structures has reached a preset convergence condition, a neural network model structure for YUV image data is generated based on the currently trained candidate network structures. This achieves automatic search for neural network model structures suitable for processing YUV image data, thereby automatically constructing a neural network model structure suitable for processing YUV image data. Furthermore, updating the controller with the performance information of the candidate network structures trained on the YUV image training data during the search process accelerates the controller's optimization efficiency, improves the speed of model structure search, and ensures the processing capability of the searched network structures for YUV data. Attached Figure Description
[0018] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0019] Figure 1 This is an exemplary system architecture diagram to which embodiments of this disclosure can be applied;
[0020] Figure 2 This is a flowchart of an embodiment of the neural network model structure search method according to the present disclosure;
[0021] Figure 3 This is a flowchart of another embodiment of the structure search method for neural network models according to the present disclosure;
[0022] Figure 4 This is a schematic diagram of the structure of an embodiment of the structure search device for the neural network model disclosed herein;
[0023] Figure 5 This is a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present disclosure. Detailed Implementation
[0024] The present disclosure will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.
[0025] It should be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0026] Figure 1 An exemplary system architecture 100 is shown that can be applied to the structure search method or apparatus for neural network models of the present disclosure.
[0027] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, a network 104, and a server 105. Network 104 serves as the medium for providing communication links between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0028] Terminal devices 101, 102, and 103 interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, and 103 can be user-end devices, on which various client applications can be installed, such as image processing applications and video interaction applications.
[0029] Terminal devices 101, 102, and 103 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices, including but not limited to smartphones, tablets, e-book readers, laptops, and desktop computers. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices. They can be implemented as multiple software programs or software modules (e.g., multiple software programs or software modules used to provide distributed services) or as a single software program or software module. No specific limitations are imposed here.
[0030] Server 105 can be a server running various services, such as image or video-based object detection, object tracking, and image optimization services. Server 105 can acquire image data collected from terminal devices 101, 102, and 103, or image data from a database, to construct training samples and automatically search and optimize the model structure of the neural network used to perform deep learning tasks.
[0031] Server 105 can also be a backend server that provides backend support for applications installed on terminal devices 101, 102, and 103. For example, server 105 can receive image or video data to be processed sent by terminal devices 101, 102, and 103, process the image or video data using a neural network model, and return the processing results to terminal devices 101, 102, and 103.
[0032] In a real-world scenario, users can use terminal devices 101, 102, and 103 to send image or video processing requests to server 105. Server 105 can run a neural network model trained for the corresponding image or video processing task, and use this neural network model to process the image or video.
[0033] It should be noted that the neural network model structure search method provided in the embodiments of this disclosure is generally executed by the server 105, and correspondingly, the neural network model structure search device is generally set in the server 105.
[0034] In some scenarios, server 105 can obtain the source data (such as training samples, unoptimized neural networks, etc.) required for model generation from a database, storage, or other devices. In this case, the exemplary system architecture 100 may not have terminal devices 101, 102, 103 and network 104.
[0035] It should be noted that server 105 can be either hardware or software. When server 105 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When server 105 is software, it can be implemented as multiple software programs or software modules (e.g., multiple software programs or software modules used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0036] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0037] Continue to refer to Figure 2 The diagram illustrates a flow 200 of an embodiment of a structure search method for a neural network model according to the present disclosure. The structure search method for the neural network model includes:
[0038] Step 201: The controller is used to search for candidate network structures from the preset network structure search space.
[0039] In this embodiment, the neural network model structure search method can search for a neural network structure model for YUV image data by iteratively performing multiple search operations. Specifically, feedback information can be initialized, for example, the feedback value can be initialized to 0. In each iteration, after updating the controller based on the current feedback information, the controller searches for candidate network structures from a preset network structure search space.
[0040] Here, the controller can be implemented as a recurrent neural network, and in each iteration, the parameters of the recurrent neural network are adjusted by backpropagation based on feedback information.
[0041] Alternatively, the controller can be implemented as a reinforcement learning algorithm, with feedback information serving as a reward to guide the update of the reinforcement learning-based neural network, thereby re-searching for better candidate network structures in each iteration.
[0042] Alternatively, the controller can also be implemented as other algorithms based on feedback information iterative optimization strategies, such as simulated annealing or genetic algorithms.
[0043] The aforementioned preset network structure search space can be a pre-constructed search space containing various network structure units. These network structure units can be the basic units for building a neural network model; specifically, they can be a single network layer, such as a single convolutional layer or a fully connected layer; or they can be structure units formed by combining multiple network layers, such as a block structure formed by combining convolutional layers, batch normalization layers, and nonlinear layers (such as ReLU).
[0044] The sequence encoding output by the controller is the encoding of the network structure unit in the preset network structure search space. By decoding this sequence encoding, the candidate network structure searched in each iteration can be obtained.
[0045] Step 202: Obtain YUV image training data and use the YUV image training data to train candidate network structures.
[0046] In this embodiment, YUV format image data can be obtained from a database as training data, or the collected YUV image data can be obtained by connecting to a terminal device to construct training data.
[0047] In some alternative implementations, the collected RGB image data can be converted into YUV format image data. This allows YUV format training data to be constructed based on commonly used RGB image data, reducing the difficulty and cost of acquiring and constructing YUV training data.
[0048] The candidate network structure searched in step 201 can be trained using YUV image training data. Specifically, the candidate network structure can be used to perform corresponding processing tasks on the YUV image training data, such as object recognition, sharpness conversion, transformation or optimization of specified objects in the image, etc. The parameters of the candidate network structure are iteratively adjusted by backpropagation of the error from performing the corresponding processing tasks based on the candidate network structure.
[0049] Step 203: Obtain the performance information of the trained candidate network structure, generate feedback information based on the performance information of the trained candidate network structure, and feed the feedback information back to the controller so that the controller can update based on the feedback information and search for new candidate network structures from the preset network structure search space.
[0050] The trained candidate network architecture can be tested using a test dataset to obtain its performance information. Here, the performance information of the trained candidate network architecture can include one or more of the following: accuracy, error, latency, processor power consumption, and computational efficiency. This performance information can also be related to the number of search operations (i.e., the number of controller iterations).
[0051] Feedback information can be generated based on the performance information of the trained candidate network structures. Positive feedback is generated if the trained candidate network structure performs well, and negative feedback is generated if its performance is poor. Specifically, the feedback value can be positively correlated with the accuracy and computational efficiency of the trained candidate network structure, and negatively correlated with its error, latency, and processor power consumption. Optionally, the feedback value can also be positively correlated with the number of search operations performed. The generated feedback information can be fed back to the controller, which updates itself and searches for new candidate network structures based on the feedback. In this way, the performance of the candidate network searched in the current iteration can be backpropagated to the controller after training. The controller iteratively updates itself and searches for new candidate network structures with the goal of optimizing the feedback information (maximizing the feedback value). Through multiple iterations of the search operation, candidate network structures that achieve better performance can be continuously searched.
[0052] Step 204: In response to the feedback information generated based on the performance information of the candidate network structure that has been trained to the point that the preset convergence condition has been met, a neural network model structure for YUV image data is generated based on the candidate network structure that has been trained to the point.
[0053] If, in the current iteration, the candidate network structure searched and trained generates feedback information based on its performance information that meets preset conditions, such as the feedback value reaching a preset threshold, the iterative search for network structures can be stopped. The candidate network structure searched in the current iteration can then be used as the final searched network structure. Alternatively, the candidate network structure trained in the current iteration can be used as a neural network model structure for YUV image data, or the candidate network structure trained in the current iteration can be further trained to generate a neural network model structure for YUV image data.
[0054] If the feedback information generated based on the performance information of the candidate network structure that has been trained does not meet the preset convergence conditions, such as the feedback value not reaching the preset threshold, the controller can be updated based on the feedback value to execute the next search operation.
[0055] The above embodiment employs a controller to search for candidate network structures from a preset network structure search space, then acquires YUV image training data, trains the candidate network structures using the YUV image training data, obtains the performance information of the trained candidate network structures, generates feedback information based on the performance information of the trained candidate network structures, and feeds the feedback information back to the controller. The controller then updates itself based on the feedback information and searches for new candidate network structures from the preset network structure search space. In response to determining that the feedback information generated based on the performance information of the currently trained candidate network structures has reached a preset convergence condition, a neural network model structure for YUV image data is generated based on the currently trained candidate network structures. This achieves automatic search for neural network model structures suitable for processing YUV image data. Furthermore, updating the controller with the performance information of the candidate network structures trained on the YUV image training data during the search process accelerates the controller's optimization efficiency, improves the speed of model structure search, and ensures the processing capability of the searched network structures for YUV data.
[0056] In some image processing scenarios, the image data acquired by the acquisition device is in YUV format, such as the YUV image data acquired by mobile video applications. Generally, YUV image data is converted to RGB format for storage. Existing neural network models for processing image data are designed for RGB format data. Since the physical meanings of RGB and YUV data differ significantly, directly applying neural network models designed for RGB data to process YUV data yields poor results. The embodiments of this disclosure, after searching for a suitable neural network model structure for YUV image data, can directly use this structure to process the acquired YUV image data without converting the image encoding format. This eliminates the latency overhead caused by converting YUV data to RGB data when applied to online image processing applications.
[0057] Continue to refer to Figure 3 This illustrates a flowchart of another embodiment of the structure search method for a neural network model according to the present disclosure. Figure 3 As shown, the flowchart 300 of the neural network model structure search method in this embodiment includes the following steps:
[0058] Step 301: The controller searches for candidate network structures from the preset network structure search space and determines the image size corresponding to the candidate network structure from the candidate image sizes.
[0059] In this embodiment, the preset network structure search space may include candidate image sizes. These candidate sizes represent the size of YUV image data that the searched candidate network structures can process.
[0060] Based on step 201 in the aforementioned method flow 200, in each search operation, the controller in this embodiment, in addition to performing the operation of searching for candidate network structures, also searches for the image size corresponding to the candidate network structure searched in the current iteration. Specifically, the decoding rules for the sequence encoding generated by the controller and the network structure and image size can be predefined. Decoding the sequence encoding generated by the controller according to these rules yields the candidate network structure and the corresponding image size. For example, one bit (e.g., the first or last bit) of the sequence encoding generated by the controller can be decoded into the image size, and the other bits in the sequence encoding are decoded into the corresponding candidate network structure.
[0061] Step 302: Obtain YUV image training data and use the YUV image training data to train candidate network structures.
[0062] Step 302 in this embodiment can be implemented with reference to the specific implementation method described in step 202 of the foregoing embodiment.
[0063] Furthermore, YUV image training data can be obtained as follows: the obtained RGB image sample data is converted into YUV image sample data, and the image size of the YUV image sample data is converted to the image size corresponding to the candidate network structure determined from the preset network structure search space.
[0064] In each iteration, the image size corresponding to the candidate network structure can be searched. Therefore, when training the candidate network structure, the acquired YUV image training data can be converted to this corresponding image size before being input into the candidate network structure for training. In this way, by converting the YUV image training data to a uniform size, the efficiency of batch processing training data for the candidate network structure can be improved, thus enhancing the training efficiency of the candidate network structure.
[0065] Alternatively, a network layer for converting image size can be added to the candidate network structure. After the obtained YUV image training data is input into the candidate network structure, it is first converted to the image size searched in step 301 by this network layer, and then processed by the candidate network structure searched in step 301.
[0066] Step 303: Obtain the performance information of the trained candidate network structure, generate feedback information based on the performance information of the trained candidate network structure, and feed the feedback information back to the controller so that the controller can update based on the feedback information and search for new candidate network structures from the preset network structure search space.
[0067] Step 304: In response to the feedback information generated based on the performance information of the candidate network structure that has been trained to the point that the preset convergence condition has been met, a neural network model structure for YUV image data is generated based on the candidate network structure that has been trained to the point.
[0068] Steps 303 and 304 in this embodiment are the same as steps 203 and 204 in the previous embodiment. The specific implementation of steps 303 and 304 can be referred to the description of steps 203 and 204 in the previous embodiment, and will not be repeated here.
[0069] Different model structures are suitable for processing different image sizes. In this embodiment, by searching for the image size corresponding to the candidate network structure in the search operation, the corresponding image size can be searched during the search for neural network models suitable for YUV data, which further optimizes the search results for neural network model structures.
[0070] Optionally, the above method flow 300 may further include:
[0071] Step 305: In response to the fact that the feedback information generated based on the performance information of the candidate network structure that has been trained has reached the preset convergence condition, the image size corresponding to the currently determined candidate network structure is determined as the target image size corresponding to the neural network model structure for YUV image data.
[0072] If the current feedback information reaches the preset convergence condition, the controller can be stopped from updating. At this point, the image size output by the controller is the target image size corresponding to the neural network model structure used for YUV image data. Thus, by searching for the neural network model structure, the suitable image size for processing by the searched neural network structure is determined. When applying the searched neural network model structure, data can be processed based on this image size, which helps improve the image processing performance of the searched neural network model structure.
[0073] Furthermore, the above method flow 300 may also include: acquiring YUV image data to be processed, and converting the size of the YUV image data to be processed into the target image size before inputting it into a neural network model structure for processing the YUV image data.
[0074] Here, the YUV image data to be processed can be obtained from an online image processing application. In a real-world scenario, after a user submits an image acquisition request in the image processing application, the device running the application acquires YUV image data as the YUV image data to be processed. The device running the image processing application can run the aforementioned neural network model structure for YUV image data to process the YUV image data, or the YUV image data to be processed can be transmitted to a device running a neural network model structure for YUV image data (such as the server of the image processing application) for processing.
[0075] Before processing the YUV image data based on the aforementioned neural network model structure, the YUV image can be converted to the target image size. In other words, by resizing the YUV data according to the image size suitable for processing by the searched neural network model structure, the processing effect of the YUV image data can be improved.
[0076] Please refer to Figure 4 As an implementation of the structure search method for the aforementioned neural network model, this disclosure provides an embodiment of a structure search device for a neural network model, which is similar to... Figure 2 and Figure 3 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0077] like Figure 4 As shown, the neural network model structure search device 400 of this embodiment includes a first search unit 401, a training unit 402, a feedback unit 403, and a generation unit 404. The first search unit 401 is configured to use a controller to search for candidate network structures from a preset network structure search space. The training unit 402 is configured to acquire YUV image training data and train candidate network structures using the YUV image training data. The feedback unit 403 is configured to acquire performance information of the trained candidate network structures, generate feedback information based on the performance information of the trained candidate network structures, and feed the feedback information back to the controller so that the controller updates based on the feedback information and searches for new candidate network structures from the preset network structure search space. The generation unit 404 is configured to, in response to determining that the feedback information generated based on the performance information of the currently trained candidate network structures has reached a preset convergence condition, generate a neural network model structure for YUV image data based on the currently trained candidate network structures.
[0078] In some embodiments, the preset network structure search space includes candidate sizes of the image; and the apparatus further includes a second search unit configured to use a controller to determine the image size corresponding to the candidate network structure from the candidate sizes of the image.
[0079] In some embodiments, the generation unit 404 is further configured to, in response to the determination that the feedback information generated based on the performance information of the candidate network structure that has been trained has reached a preset convergence condition, determine the image size corresponding to the currently determined candidate network structure as the target image size corresponding to the neural network model structure for YUV image data.
[0080] In some embodiments, the above apparatus further includes a processing unit configured to: acquire YUV image data to be processed; convert the size of the YUV image data to be processed into the target image size and then input it into a neural network model structure for processing the YUV image data.
[0081] In some embodiments, the training unit 402 is configured to acquire YUV image training data in the following manner: converting the acquired RGB image sample data into YUV image sample data, and converting the image size of the YUV image sample data into the image size corresponding to the candidate network structure determined from the preset network structure search space.
[0082] Each unit in the aforementioned device 400 and the reference Figure 2 and Figure 3 The steps described in the method correspond to those steps. Therefore, the operations, features, and technical effects described above for the structure search method of neural network models are also applicable to device 400 and the units contained therein, and will not be repeated here.
[0083] The following is for reference. Figure 5 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 1 The diagram shows the structure of server 500. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0084] like Figure 5As shown, the electronic device 500 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. The RAM 503 also stores various programs and data required for the operation of the electronic device 500. The processing unit 501, ROM 502, and RAM 503 are interconnected via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0085] Typically, the following devices can be connected to I / O interface 505: input devices 506 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 507 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 508 including, for example, hard disks; and communication devices 509. Communication device 509 allows electronic device 500 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 500 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 5 Each box shown can represent a device or multiple devices as needed.
[0086] Specifically, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by a processing device 501, it performs the functions defined in the methods of embodiments of this disclosure. It should be noted that the computer-readable medium described in embodiments of this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0087] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: use a controller to search for candidate network structures from a preset network structure search space; acquire YUV image training data and train the candidate network structures using the YUV image training data; acquire performance information of the trained candidate network structures, generate feedback information based on the performance information of the trained candidate network structures, and feed the feedback information back to the controller, so that the controller updates based on the feedback information and searches for new candidate network structures from the preset network structure search space; in response to determining that the feedback information generated based on the performance information of the currently trained candidate network structures has reached a preset convergence condition, generate a neural network model structure for YUV image data based on the currently trained candidate network structures.
[0088] Computer program code for performing the operations of embodiments of this disclosure can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages—such as Java, Smalltalk, and C++—and conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0089] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0090] The units described in the embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including a first search unit, a training unit, a feedback unit, and a generation unit. The names of these units do not necessarily limit the specific unit; for example, the first search unit may also be described as "a unit that uses a controller to search for candidate network structures from a preset network structure search space."
[0091] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.
Claims
1. A structural search method for neural network models, include: A controller is used to search for a candidate network structure and an image size corresponding to the candidate network structure from a preset network structure search space; Based on the image size corresponding to the candidate network structure, obtaining YUV image training data, and using the YUV image training data to train the candidate network structure; Acquire performance information of the candidate network structure that has been trained, generate feedback information according to the performance information of the candidate network structure that has been trained, and feed the feedback information back to the controller, so that the controller searches for a new candidate network structure from a preset network structure search space after being updated based on the feedback information; In response to determining that feedback information generated based on performance information of a candidate network structure that has been currently trained reaches a preset convergence condition, a neural network model structure for YUV image data is generated based on the candidate network structure that has been currently trained; The acquiring YUV image training data based on the image size corresponding to the candidate network structure includes: converting the acquired RGB image sample data into YUV image sample data, and converting the image size of the YUV image sample data into the image size corresponding to the candidate network structure determined in the preset network structure search space; Alternatively, a network layer for converting the image size is added to the candidate network structure, and after the acquired YUV image training data is input into the network structure, it is converted to the searched image size through the network layer and processed through the searched candidate network structure; The method of training the candidate network structure using the YUV image training data includes: using the candidate network structure to perform processing tasks such as clarity conversion, transformation or optimization of specified objects in the image on the YUV image training data; and iteratively adjusting parameters of the candidate network structure based on error back propagation of the candidate network structure performing the processing tasks.
2. The method according to claim 1, in, The preset network structure search space includes candidate sizes of the image; as well as The method further comprises: A controller is used to determine the image size corresponding to the candidate network structure from the candidate sizes of the image.
3. The method according to claim 2, in, The method further comprises: In response to determining that feedback information generated based on performance information of a candidate network structure that has completed current training reaches a preset convergence condition, the image size corresponding to the currently determined candidate network structure is determined as the target image size corresponding to the neural network model structure for YUV image data.
4. The method according to claim 3, in, The method further comprises: Get the YUV image data to be processed; The size of the YUV image data to be processed is converted into the target image size and then input into the neural network model structure for YUV image data for processing.
5. A structure search device for a neural network model, include: A first search unit is configured to use a controller to search for a candidate network structure and an image size corresponding to the candidate network structure from a preset network structure search space; A training unit is configured to obtain YUV image training data based on the image size corresponding to the candidate network structure, and train the candidate network structure using the YUV image training data; A feedback unit is configured to obtain performance information of the candidate network structure after training, generate feedback information according to the performance information of the candidate network structure after training, and feed the feedback information back to the controller, so that the controller searches for a new candidate network structure from a preset network structure search space after updating based on the feedback information; A generating unit, configured to generate a neural network model structure for YUV image data based on the candidate network structure currently trained, in response to determining that feedback information generated based on performance information of the candidate network structure currently trained reaches a preset convergence condition; The training unit is configured to obtain YUV image training data in the following manner: converting the obtained RGB image sample data into YUV image sample data, and converting the image size of the YUV image sample data to the image size corresponding to the candidate network structure determined in the preset network structure search space; Alternatively, a network layer for converting the image size is added to the candidate network structure, and after the acquired YUV image training data is input into the network structure, it is converted to the searched image size through the network layer and processed through the searched candidate network structure; The training unit is further configured to: use the candidate network structure to perform processing tasks such as clarity conversion, transformation or optimization of specified objects in the image on the YUV image training data; and iteratively adjust the parameters of the candidate network structure based on the error back propagation of the candidate network structure performing the processing tasks.
6. The device according to claim 5, in, The preset network structure search space includes candidate sizes of the image; as well as The device also includes: The second search unit is configured to use a controller to determine the image size corresponding to the candidate network structure from the candidate sizes of the image.
7. The device according to claim 6, in, The generation unit is also configured to, in response to determining that feedback information generated based on performance information of a candidate network structure currently trained has reached a preset convergence condition, determine the image size corresponding to the currently determined candidate network structure as the target image size corresponding to the neural network model structure for YUV image data.
8. The device according to claim 7, in, The device further comprises: a processing unit configured to: Get the YUV image data to be processed; The size of the YUV image data to be processed is converted into the target image size and then input into the neural network model structure for YUV image data for processing.
9. An electronic device, include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 4.
10. A computer readable medium having a computer program stored thereon, in, When the program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
