Neural network model training method and apparatus, program product and storage medium
By introducing a reference neural network model into the neural network model and updating parameters iteratively, the problem of low training efficiency and vulnerability to collapse of the neural network model is solved, achieving efficient model training and good confidentiality.
Patent Information
- Application Number
- PCT/CN2024/104865
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-14
- Filing Date
- 2024-07-11
- Publication Date
- 2025-01-23
AI Technical Summary
As the number of network layers of neural network models increases, the scale of network parameters increases, resulting in increased model training difficulty and increased training time. In particular, self-supervised learning models are prone to pattern or dimension collapse and are difficult to train.
A method to train neural network models, processing neural network models and reference neural network models by initialized information, and updating parameters of the two models through multiple iterations. In each iteration, the output results of the reference module are determined based on the parameters of the training sample and reference module. The output results of the processing module are determined based on the parameters of the mask sample and the processing module, and the parameters of the processing module and the reference module are finally updated.
This method can effectively improve the training efficiency of the neural network model, reduce the time-consuming of model training, avoid collapse problems during the training process, and has good confidentiality, and is suitable for application scenarios with high confidentiality requirements.
Smart Images

Figure CN2024104865_23012025_PF_FP_ABST
Abstract
Description
Method, device, program product and storage medium for training neural network model Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, and more specifically, to a method, apparatus, computer program product, and storage medium for training a neural network model, as well as a method, apparatus, computer program product, and storage medium for performing information processing tasks based on a neural network model.
[0002] Background of the Invention
[0003] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI primarily studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making. Research in the field of AI encompasses robotic control, natural language processing, computer vision, decision-making and reasoning, human-computer interaction, information recommendation and search, and more.
[0004] Neural networks (NNs), a key branch of artificial intelligence, are network structures that mimic the behavioral characteristics of animal neural networks to process information. A neural network's structure consists of a large number of interconnected nodes (or neurons). Based on a specific computational model, neural networks process information by learning and training input information. A neural network consists of an input layer, a hidden layer, and an output layer. The input layer receives input signals; the output layer outputs the neural network's computational results; and the hidden layer handles computational processes such as learning and training, serving as the network's memory unit. The hidden layer's memory function is represented by a weight matrix, typically with one weight coefficient for each neuron.
[0005] As the number of neural network layers increases, the size of the network parameters also increases. This increases the difficulty and time required for model training. Self-supervised learning (SSL) models are particularly challenging to train due to the risk of pattern or dimensionality collapse. Therefore, effectively improving the training efficiency of neural network models and reducing the training time are pressing challenges.
[0006] Summary of the Invention
[0007] Since the existing method of training a neural network model usually adopts a method of calculating the output of all processing modules of the neural network model in sequence through forward propagation, and then calculating the gradient of the loss function with respect to the parameters of each processing module in sequence through back propagation, and then updating the parameters of the entire neural network according to the gradient, in this method, both the forward propagation and back propagation processes involve all processing modules of the neural network, and in the back propagation process, each processing module must clearly know the network parameters of all subsequent processing modules before the network parameters can be updated, so the training efficiency of the entire model is low.
[0008] In order to improve the training efficiency of a neural network model, the present disclosure provides a method for training a neural network model, comprising: initializing an information processing neural network model and a reference neural network model corresponding to the information processing neural network model, wherein the information processing neural network model includes multiple processing modules and the reference neural network model includes multiple reference modules; updating the parameters of the information processing neural network model and the reference neural network model through multiple iterations, wherein in each iteration, based on a training sample and the parameters of the multiple reference modules, output results corresponding to the multiple reference modules are determined; based on a mask sample obtained after masking the training sample and the parameters of the multiple processing modules, output results corresponding to the multiple processing modules are determined; based on the output results corresponding to the multiple processing modules and the output results corresponding to the multiple reference modules, the parameters of the multiple processing modules are updated; and the parameters of the multiple reference modules are updated based on the updated parameters of the multiple processing modules.
[0009] An embodiment of the present disclosure also provides a device for training a neural network model, comprising: an initialization module, configured to: initialize an information processing neural network model and a reference neural network model corresponding to the information processing neural network model, wherein the information processing neural network model includes multiple processing modules, and the reference neural network model includes multiple reference modules; a parameter updating module, configured to: update the parameters of the information processing neural network model and the reference neural network model through multiple iterations, wherein in each iteration, based on the training sample and the parameters of the multiple reference modules, the output results corresponding to the multiple reference modules are determined; based on the mask sample obtained after masking the training sample and the parameters of the multiple processing modules, the output results corresponding to the multiple processing modules are determined; based on the output results corresponding to the multiple processing modules and the output results corresponding to the multiple reference modules, the parameters of the multiple processing modules are updated; and the parameters of the multiple reference modules are updated based on the updated parameters of the multiple processing modules.
[0010] An embodiment of the present disclosure also provides a method for information processing based on a neural network model, comprising: obtaining information to be processed, wherein the information to be processed includes at least one of image information, text information, audio information, and video information; processing the information to be processed based on the information processing neural network model to obtain a result of processing the information to be processed, wherein the information processing neural network model is trained by the above-mentioned method of training a neural network model.
[0011] An embodiment of the present disclosure further provides a computer program product, which includes computer software code. When the computer software code is executed by a processor, it provides the above method.
[0012] An embodiment of the present disclosure further provides a computer-readable storage medium having computer-executable instructions stored thereon, which provide the above method when executed by a processor.
[0013] Since the method of training a neural network model disclosed in the present invention can train each processing module in the information processing neural network model individually, and each processing module can be trained in parallel, the training efficiency of the neural network model can be effectively improved.
[0014] The method for training a neural network model disclosed in the present invention can train the processing module only based on the output results of the processing module and the output results of the reference module corresponding to the processing module. This process does not require clarifying the gradient of the loss function with respect to the parameters of other processing modules, thereby reducing the difficulty of training the neural network model, effectively saving computer resources, and reducing the requirements for computer performance.
[0015] At the same time, because each processing module in the information processing neural network model can be trained independently, there is no need for the processing modules to share their respective network parameters. Therefore, the method of training the neural network model disclosed in the present invention has good confidentiality and can better protect the parameters of each processing module and prevent the parameters from being stolen. Therefore, the method of training the neural network model disclosed in the present invention has obvious advantages for application scenarios with high confidentiality requirements (for example, involving business secrets, personal privacy, etc.).
[0016] The disclosed method for training a neural network model can effectively reduce the amount of computation required by a computer, fully utilize computer resources to implement parallel training of multiple processing modules, and thus reduce the training time of the neural network model. Since the disclosed method for training a neural network model can train each processing module separately, the training efficiency is high, and thus it can be better applied to training scenarios of large neural network models or real-time training scenarios of neural network models (i.e., training is performed while task processing is performed, rather than the task processing process being completely independent of the training process).
[0017] In addition, compared with the existing neural network model training method based on backpropagation, the neural network model training method disclosed in the present invention can stably train the neural network model and effectively avoid the collapse problem during the neural network training process.
[0018] BRIEF DESCRIPTION OF THE DRAWINGS
[0019] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some exemplary embodiments of the present disclosure, and those skilled in the art can derive other drawings based on these drawings without inventive effort.
[0020] Herein, in the accompanying drawings:
[0021] FIG1 shows a schematic diagram of an application scenario according to an embodiment of the present disclosure.
[0022] FIG2 is a schematic diagram illustrating an example of a scenario in which information processing and training are performed based on a neural network model according to an embodiment of the present disclosure.
[0023] 3A and 3B are schematic flow charts illustrating a method for training a neural network model according to an embodiment of the present disclosure;
[0024] 4A-4E are schematic diagrams illustrating a process of processing a training sample according to an embodiment of the present disclosure;
[0025] FIG5 is a schematic diagram illustrating a process of training a neural network model according to an embodiment of the present disclosure;
[0026] FIG6 is a schematic flow chart illustrating a method for performing information processing based on a neural network model according to an embodiment of the present disclosure;
[0027] FIG7 is a schematic diagram illustrating an information processing process based on a neural network model according to an embodiment of the present disclosure;
[0028] FIG8 is a schematic diagram showing the composition of an apparatus for training a neural network model according to an embodiment of the present disclosure;
[0029] FIG9 is a schematic diagram showing the composition of an apparatus for performing information processing based on a neural network model according to an embodiment of the present disclosure; and
[0030] FIG10 illustrates an architecture of a computing device according to an embodiment of the present disclosure.
[0031] Modes for Carrying Out the Invention
[0032] In order to make the purpose, technical solutions and advantages of the present disclosure more apparent, the exemplary embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described herein.
[0033] Furthermore, in this specification and the drawings, steps and elements having substantially the same or similar features are denoted by the same or similar reference numerals, and repeated descriptions of these steps and elements will be omitted.
[0034] In addition, in this specification and the drawings, elements are described in singular or plural form, depending on the embodiment. However, the singular and plural forms are appropriately selected for the situations presented merely for convenience of explanation and are not intended to limit the present disclosure thereto. Therefore, the singular form may include the plural form, and the plural form may also include the singular form, unless the context clearly indicates otherwise.
[0035] In this specification and the accompanying drawings, substantially the same or similar steps and elements are denoted by the same or similar reference numerals, and repeated descriptions of these steps and elements will be omitted. At the same time, in the description of the present disclosure, the terms "first", "second", etc. are only used to distinguish the description and are not to be understood as indicating or implying relative importance or ranking.
[0036] The various neural networks (or neural network models) that can be used in the embodiments of the present disclosure below can all be artificial intelligence models, especially artificial intelligence-based neural network models. Typically, artificial intelligence-based neural network models are implemented as acyclic graphs in which neurons are arranged in different layers. Typically, a neural network model includes an input layer and an output layer, which are separated by at least one hidden layer. The hidden layer transforms the input received by the input layer into a representation that is useful for generating output in the output layer. The network nodes (i.e., neurons) are fully connected to the nodes in the adjacent layers via edges, and there are no edges between the nodes in each layer. The data received at the nodes of the input layer of the neural network are propagated to the nodes of the output layer via any one of the hidden layer, activation layer, pooling layer, convolutional layer, etc. The input and output of the neural network model can take various forms, and the present disclosure is not limited to this.
[0037] In this disclosure, considering that the lack of rationality and local plasticity in backpropagation in neural network models such as SSL models remains a fundamental unresolved problem, a new biologically plausible algorithm is proposed. This algorithm operates in a manner that more closely satisfies the constraints of neural circuits. Within the framework of an energy-based model that only utilizes locally available information, all free variables in the proposed model are autonomously optimized to minimize the prediction masking and encoding functions used to define local and global energies. This can eliminate collapse and help stabilize pre-training. The technical solutions in the embodiments of this disclosure can be used not only for SSL models but also for various neural network models such as supervised models.
[0038] The embodiments of the present disclosure will be further described below with reference to the accompanying drawings.
[0039] First, an application scenario of the method and corresponding apparatus according to an embodiment of the present disclosure will be described with reference to Figure 1. Figure 1 shows a schematic diagram of an application scenario 100 according to an embodiment of the present disclosure, in which a server 110 and multiple terminals 120 are schematically shown.
[0040] The information processing neural network model of the embodiment of the present disclosure can be specifically integrated into various electronic devices, for example, any electronic device in the server 110 and multiple terminals 120 in Figure 1. For example, the information processing neural network model can be integrated into the terminal 120. The terminal 120 can be a mobile phone, a tablet computer, a laptop computer, a desktop computer, a personal computer (PC, Personal Computer), a smart speaker or a smart watch, etc., but is not limited to this. For another example, the information processing neural network model can also be integrated into the server 110. The server 110 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected via wired or wireless communication, and the present disclosure does not limit this.
[0041] It is understood that the apparatus for performing information processing based on a neural network model according to an embodiment of the present disclosure may be a terminal, a server, or a system composed of a terminal and a server. The information processing method according to an embodiment of the present disclosure may be executed on a terminal, a server, or a combination of a terminal and a server.
[0042] The information processing neural network model provided by the embodiments of the present disclosure can be used to perform various information processing tasks, including: information extraction (for example, key information extraction, information search, feature extraction, etc.), information classification (for example, image classification, disease diagnosis, spam information identification), information restoration (for example, image restoration, incomplete information prediction, etc.), information style transfer (for example, image style transfer, timbre conversion, etc.), information enhancement (for example, image clarity enhancement, audio denoising, etc.), information mining (for example, big data mining, network information mining, etc.), information recognition (for example, disease diagnosis, spam information identification, etc.), machine translation, etc., and are not limited thereto. In the present disclosure, the information processed based on the neural network model may include: images, text, audio, video, number series, etc.
[0043] The information processing neural network model provided by the embodiments of the present disclosure may also involve artificial intelligence cloud services in the field of cloud technology. Among them, cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and network in a wide area network or a local area network to realize the calculation, storage, processing and sharing of data. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the application of cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The background services of technical network systems require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the background system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0044] Among them, AI cloud services, also commonly referred to as AIaaS (AI as a Service), are a mainstream AI platform service model. Specifically, AIaaS platforms separate several common AI services and provide them as standalone or packaged services in the cloud. This service model is similar to opening an AI-themed mall: all developers can access one or more AI services provided by the platform through the application programming interface (API). Some experienced developers can also use the platform's AI framework and AI infrastructure to deploy and operate their own cloud AI services.
[0045] FIG2 is a schematic diagram illustrating an example of a scenario 200 for performing information processing and training based on a neural network model according to an embodiment of the present disclosure.
[0046] During the training phase, the server 110 can train the neural network model based on the training samples. After the training is completed, the server can deploy the trained neural network model to one or more servers (or cloud services) to provide artificial intelligence services related to information processing based on the neural network model. It is worth noting that all training samples used in this disclosure comply with the legality, morality and privacy requirements of laws and regulations. Specifically, the sources of all training samples are legal, and the user's explicit permission has been obtained during the collection process. In addition, all training samples used in this disclosure comply with the privacy protection principle. These training samples have been strictly screened and cleaned, and will not be disclosed to any third party without explicit authorization.
[0047] In the stage of information processing based on the neural network model, it is assumed that a client or application (e.g., an image processing application, a text processing application, etc.) that interacts with the server 110 for information processing has been installed on the user terminal 120 performing the information processing. The user terminal 120 can send an information processing request to the server 110 corresponding to the application via the network to request the neural network deployed on the server 110 to process the information. For example, after receiving the information processing request, the server 110 uses the trained neural network model to perform information processing in response to the information processing request and feeds back the predicted information processing result to the user terminal 120. The user terminal 120 can receive the information processing result. Afterwards, the user terminal 120 can perform further analysis or processing based on the information processing result.
[0048] It is worth noting that the training sample data shown in FIG2 can also be updated in real time. For example, the user can rate the information processing results. For example, if the user believes that the information processing results are both reasonable and accurate, the user can give the information processing results a high score, and the server 110 can use the information processing results as positive samples for real-time training of the neural network model. If the user gives the information processing results a low score, the server 110 can use the information processing results as negative samples.
[0049] The training sample set shown in FIG2 can also be set in advance. For example, referring to FIG2 , the server can obtain training data (e.g., image training samples, text training samples, audio training samples, video training samples, etc.) from a database and then generate a training sample set for the neural network model. Of course, the present disclosure is not limited to this.
[0050] FIG3A is a schematic flowchart illustrating a method 300 for training a neural network model according to an embodiment of the present disclosure.
[0051] In step S310, the information processing neural network model and the reference neural network model corresponding to the information processing neural network model are initialized. In one example, the relationship between the reference neural network model and the information processing neural network model can be understood as similar to the relationship between the teacher-student model in the knowledge distillation learning process. The purpose of setting the reference neural network is to obtain the target to be learned by the information processing neural network, so as to realize the training of the information processing neural network and stabilize its training to prevent collapse. In one embodiment, the structure and parameters of the reference neural network model corresponding to the information processing neural network model can be determined based on the structure and parameters of the information processing neural network model.
[0052] It should be noted that the information processing neural network model in the present disclosure may include multiple processing modules, and the reference neural network model may include multiple reference modules.
[0053] According to an embodiment of the present disclosure, the multiple processing modules may be L processing modules, the multiple reference modules may be L reference modules, the lth processing module among the L processing modules and the lth reference module among the L reference modules have the same structure, wherein L and l are positive integers, and l≤L.
[0054] It should be understood that each processing module in the plurality of processing modules may have the same structure or function as the other processing modules, or may have different structures or functions. Similarly, each reference module in the plurality of reference modules may have the same structure or function as the other reference modules, or may have different structures or functions.
[0055] According to an embodiment of the present disclosure, the initial parameters of the information processing neural network model and the reference neural network model can be determined based on random numbers, or the initial parameters of the information processing neural network model and the reference neural network model can be determined based on the experience of the technician. The initial parameters of the information processing neural network model and the reference neural network model can be the same or different. Optionally, the information processing neural network model can be pre-trained a predetermined number of times, and then the parameters of the pre-trained information processing neural network model are used as the initial parameters of the reference neural network model.
[0056] It should be noted that each of the multiple processing modules, or each of the multiple reference modules, can be a sub-neural network model or a neural network layer. For example, each of the processing modules or each of the reference modules can include: a convolutional neural network, a neural network based on an attention mechanism, a recurrent neural network, a recursive neural network, a feedforward neural network, a generative adversarial neural network, a deep neural network, and the like.
[0057] In step S320, the parameters of the information processing neural network model and the reference neural network model are updated through multiple iterations.
[0058] In order to more clearly illustrate step S320, Fig. 3B further illustrates the processing steps in each iteration. As shown in Fig. 3B, step S320 may specifically include step S321, step S322, step S323, and step S324.
[0059] In step S321, based on the training sample and the parameters of the multiple reference modules, the output results corresponding to the multiple reference modules are determined. In one example, the specific process for determining the output results corresponding to the multiple reference modules may be: inputting the training sample into the multiple reference modules for forward calculation, and outputting the corresponding calculation results. This process may not include backward propagation of gradients, so the parameters of the reference modules may be fixed during this process.
[0060] It should be understood that the training samples may include one or more of image training samples, text training samples, audio training samples, and video training samples (optionally, may be processed into both image and audio) training samples.
[0061] In step S322, based on the mask sample obtained after masking the training sample and the parameters of the multiple processing modules, the output results corresponding to the multiple processing modules are determined. In one example, the specific process for determining the output results corresponding to the multiple processing modules can be: inputting the mask sample into the multiple processing modules for forward calculation, and outputting the corresponding calculation results. This process also does not require backward propagation of gradients, so the parameters of the processing modules can be fixed during this process.
[0062] For example, using the image training sample in FIG4A as an example, by performing mask processing on image training sample P0, mask samples P0-1, P0-2, and P0-i with different mask positions can be obtained. Using the text training sample in FIG4B as an example, by performing mask processing on text training sample T0, mask samples T0-1, T0-2, and T0-i with different mask positions can be obtained. Using the audio training sample in FIG4C as an example, by performing mask processing on audio training sample V0, mask samples V0-1, V0-2, and V0-i with different mask positions can be obtained. For the examples in FIG4A-4C , i is a positive integer.
[0063] According to an embodiment of the present disclosure, performing mask processing on the training sample may include performing mask processing on the training sample with different sizes (e.g., size, length, etc.), mask processing at different positions, and mask processing on the training sample with different shapes (e.g., square, circular, irregular, etc.). For example, taking the image training sample in FIG4D as an example, by performing mask processing on the image training sample P1, mask samples P1-1, P1-2, ..., and P1-j with different mask sizes and positions can be obtained, where j is a positive integer.
[0064] By performing different mask processing on the training samples, the diversity of the mask samples processed by the processing module can be increased, thereby improving the performance of the trained processing module, and thus more accurate processing results can be obtained based on the trained processing module.
[0065] In step S323 , the parameters of the plurality of processing modules are updated based on the output results corresponding to the plurality of processing modules and the output results corresponding to the plurality of reference modules.
[0066] According to an embodiment of the present disclosure, for the lth processing module among the L processing modules, the parameters of the lth processing module can be updated based on the output result of the lth processing module and the output result of the reference module corresponding to the lth processing module.
[0067] It should be noted that the reference module corresponding to the lth processing module may be the lth reference module among the L reference modules, but is not limited thereto. Optionally, the reference module corresponding to the lth processing module may include one or more reference modules surrounding the lth reference module. For example, the reference modules corresponding to the lth processing module include the 1mth reference module to the 1+nth reference module, where m and n are integers satisfying m ≥ 0, n ≥ 0, 1m ≥ 1, and 1+n ≤ L, and the values of m and n may be the same or different.
[0068] According to an embodiment of the present disclosure, the value of an energy function can be calculated based on the output results corresponding to the multiple processing modules and the output results corresponding to the multiple reference modules, and the parameters of the multiple processing modules can be updated based on the value of the energy function, wherein the energy function is used to evaluate the accuracy of the output results of the multiple processing modules.
[0069] It should be understood that the energy function can be a global energy function for evaluating the difference between the output result of the Lth processing module and the output result of the Lth reference module (i.e., a global optimization objective shared by all processing modules), or a local energy function for evaluating the difference between the output result of the lth processing module and the output result of the reference module corresponding to the lth processing module (i.e., an optimization objective for a single processing module). Alternatively, the energy function can also be determined based on both the global energy function and the local energy function (e.g., by adding, averaging, or weighted averaging the two).
[0070] According to an embodiment of the present disclosure, the energy function (whether a global energy function or a local energy function) may be in various forms.
[0071] For example, for the lth processing module among the L processing modules, the value of the first local energy function may be determined based on a difference between an output result of the lth processing module and an output result of a reference module corresponding to the lth processing module.
[0072] In addition, the expected output result of the lth processing module can be determined based on the global energy function; and the value of the second local energy function can be determined based on the difference between the output result of the lth processing module and the expected output result of the lth processing module.
[0073] Specifically, in the process of determining the expected output result of the lth processing module based on the global energy function, a reverse-calculated difference of the output result of the lth processing module can be determined based on the value of the global energy function; and then, based on the reverse-calculated difference of the output result of the lth processing module and the output result of the lth processing module, the expected output result of the lth processing module is determined. The reverse-calculated difference of the output result of the lth processing module is obtained by sequentially propagating the difference between the output result of the Lth processing module and the output result of the Lth reference module to the lth processing module.
[0074] For example, for the l+kth processing module from the Lth processing module to the lth processing module, the partial derivative of the output result of the l+kth processing module with respect to the output result of the l+k-1th processing module can be calculated (the output result of the l+k-1th processing module is the input of the l+kth processing module); then the reverse calculation difference of the output result of the l+kth processing module is determined based on the partial derivative and the reverse calculation difference of the output result of the l+k+1th processing module, where k is an integer and satisfies k≥0, l+k+1≤L.
[0075] According to an embodiment of the present disclosure, a comprehensive local energy function may be determined based on different local energy functions, and the parameters of the lth processing module may be updated based on the comprehensive local energy function.
[0076] For example, a third local energy function can be determined based on the first and second local energy functions, and the parameters of the first processing module can be updated based on the third local energy function. In one embodiment, the third local energy function can be determined by performing a weighted calculation on the first and second local energy functions.
[0077] According to an embodiment of the present disclosure, the parameters of the lth processing module may be updated based on different local energy functions in different situations.
[0078] For example, when the first local energy function corresponding to the lth processing module has not converged, the parameters of the lth processing module can be updated based on the value of the first local energy function corresponding to the lth processing module (i.e., only considering the optimization objective of a single processing module); and when the first local energy function corresponding to the lth processing module converges, the parameters of the lth processing module can be updated based on the second local energy function corresponding to the lth processing module (determined based on the global energy function) (i.e., considering the global optimization objective common to all processing modules).
[0079] In step S324 , the parameters of the plurality of reference modules are updated based on the updated parameters of the plurality of processing modules.
[0080] According to an embodiment of the present disclosure, the parameters of the multiple reference modules can be updated using the values of the parameters of the multiple processing modules in at least one previous iteration. For example, the parameters of the multiple reference modules can be updated using the exponential moving average of the parameters of the multiple processing modules in at least one previous iteration. That is, assuming that the parameters of the updated processing module are W and the parameters of the current reference module are Then the parameters of the updated reference module can be Wherein, 0≤τ≤1. In addition, the parameters of the multiple reference modules may be updated using the arithmetic mean or weighted mean of the parameters of the multiple processing modules in at least one previous iteration (optionally, the weight of the latest parameter of the processing module may be set to be greater than the weight of the previous parameter), and the present disclosure is not limited thereto.
[0081] It should be understood that the above-mentioned method 300 for training a neural network model can be used for both supervised training of the information processing neural network model and self-supervised training of the information processing neural network model.
[0082] Taking the image training sample shown in FIG4A as an example, when the information processing neural network model is subjected to self-supervisory training, the process of processing the training sample can be as shown in FIG4E .
[0083] In step S1, the training image sample P0 may be masked at different positions to obtain mask samples P0-1...P0-i. Optionally, the training samples may be masked based on the information contained in the image training samples. For example, for an information processing neural network used to identify people in an image, the portion of the image containing the people may be masked with a finer granularity (e.g., each mask size is smaller), while the portion containing the surrounding environment may be masked with a coarser granularity (e.g., each mask size is larger), so that the trained neural network model focuses on learning the characteristics of the people.
[0084] In step S2, the structure and parameters of the corresponding reference neural network model can be determined based on the structure and parameters of the information processing neural network model. For example, the structure of each processing module in the information processing neural network model can correspond one-to-one with the structure of each reference module in the reference neural network model, and both can extract image features. The difference between the two is that the reference neural network model extracts image features based on the complete training image sample P0, while the information processing neural network model extracts image features based on the mask sample. The parameters of each reference module in the reference neural network model can be determined based on the historical results of the parameters of the corresponding processing module. For example, before training the information processing neural network model based on the reference neural network model, the information processing neural network model can be separately supervised trained a predetermined number of times (e.g., 50 times, but not limited to this) using labeled image training samples (it should be noted that each training in the predetermined number of supervised trainings refers to an epoch of training, not a batch of training). The parameters of the information processing neural network model, updated the predetermined number of times, are then used as the initial parameters of the reference neural network model. The information processing neural network model is then trained based on the reference neural network model to update the parameters of the information processing neural network model and the reference neural network model. During the training process of the information processing neural network model, each time the parameters of the information processing neural network model are updated, the parameters of the corresponding reference module are updated using the parameters of the updated processing module.
[0085] In step S3, the training image sample P0 may be forward processed using a reference neural network model to obtain a feature representation F0 of the training image sample P0.
[0086] At the same time, in step S4, the information processing neural network model can be used to forward process the mask samples P0-1...mask samples P0-i to predict the predicted feature representations F0-1...F0-i of the training image sample P0 based on the mask samples P0-1...mask samples P0-i. It should be noted that the predicted feature representation consists of two parts, namely, the feature representation for the unmasked portion (i.e., the portion of the mask sample filled with the diagonal texture shown in FIG4E ) and the feature representation for the masked portion (i.e., the portion of the mask sample filled with the dotted texture shown in FIG4E ).
[0087] It should be noted that the reference neural network model can perform feature encoding on the complete training image sample P0 to obtain the complete feature representation F0 of the training image sample P0. However, the information processing neural network model performs feature encoding on the masked sample, so it can only obtain the feature representation of the unmasked portion first. Then, based on the feature representation of the unmasked portion, it decodes and predicts the feature representation of the masked portion to obtain the predicted feature representation of the training image sample P0.
[0088] Then, in step S5, an energy function can be calculated based on the difference between the output results corresponding to the information processing neural network model (i.e., the feature representation F0-1...F0-i of the mask sample P0-i) and the output results corresponding to the reference neural network model (i.e., the feature representation F0 of the training image sample P0), and the parameters of the information processing neural network model can be updated based on the value of the energy function.
[0089] In the embodiment of FIG4E , the information processing neural network model can be used to extract image features, or predict (or repair) the incomplete parts of the image. In the processing process shown in FIG4E , it is only necessary to predetermine the structure of the image training samples and the information processing neural network model to realize the training of the information processing neural network model. In this process, it is not necessary to provide labels for the training samples, and there is no need to spend time and manpower costs to annotate the training samples, which greatly improves the processing efficiency of the neural network model used for image processing. For example, in the process of training a neural network model for processing medical images, the annotation of medical images requires careful judgment by professional doctors, and the annotation efficiency is very low. The method disclosed in the present invention can effectively reduce the annotation cost and improve the efficiency of model training.
[0090] According to the examples of Figures 4A and 4E, the present disclosure also discloses a method for training a neural network model for processing images. Optionally, the neural network model for processing images is an example of the information processing neural network model described above. The method includes: initializing a neural network model for processing images and a reference neural network model corresponding to the neural network model for processing images, wherein the neural network model for processing images includes multiple processing modules and the reference neural network model includes multiple reference modules; updating the parameters of the neural network model for processing images and the reference neural network model through multiple iterations, wherein in each iteration, based on the image training sample and the parameters of the multiple reference modules, the image features corresponding to the multiple reference modules are determined; based on the mask sample obtained after masking the image training sample and the parameters of the multiple processing modules, the image features corresponding to the multiple processing modules are determined; based on the image features corresponding to the multiple processing modules and the image features corresponding to the multiple reference modules, the parameters of the multiple processing modules are updated; and based on the updated parameters of the multiple processing modules, the parameters of the multiple reference modules are updated. Then, optionally, a neural network model that has been trained for processing images can be used to extract features of the image data to further complete face recognition tasks or disease diagnosis and treatment tasks, etc.
[0091] Furthermore, in the case of having predetermined training sample labels, the information processing neural network model can also be subjected to supervised training using a process similar to FIG4E . That is, method 300 is applicable to both supervised training and self-supervised training. In the case of supervised training of the information processing neural network model, the global energy function can be determined based on the difference between the output result of the Lth processing module and the predetermined training sample label (i.e., the result that the Lth processing module should output).
[0092] When the updated information processing neural network model satisfies predetermined conditions (e.g., energy function convergence, reaching a predetermined number of training times, etc.), the training of the information processing neural network model can be determined to be complete, and a trained information processing neural network model can be obtained. At this point, the trained information processing neural network model can be used to extract features (of multimedia information such as images, text, audio, and video), predict missing information (including at least one of multimedia information such as images, text, audio, and video), and the like.
[0093] Optionally, the information processing training samples corresponding to the information processing tasks can be used to further train the trained information processing neural network model (for example, fine-tuning the structure and parameters of the information processing neural network model) to complete downstream information processing tasks such as information extraction, information classification, information restoration, information style transfer, information enhancement, information mining, and information recognition.
[0094] FIG5 is a schematic diagram illustrating a process of training a neural network model according to an embodiment of the present disclosure.
[0095] Figure 5 illustrates the process of training an information processing neural network model using audio training sample V1 as an example. It should be understood that audio training sample V1 can be masked using the method shown in Figure 4C to obtain multiple different mask samples V1-1, V1-2, and V1-j, where j is a positive integer. Figure 5 uses mask sample V1-1 as an example only for illustration. The process of training an information processing neural network model using other mask samples is similar to that shown in Figure 5 and will not be further described here.
[0096] As shown in FIG5 , the information processing neural network model M1 includes L processing modules (such as the blocks M1-1, M1-2, ..., M1-L filled with dot textures in FIG5 ). Based on the information processing neural network model M1 including L processing modules, a reference neural network model M2 including L reference modules (such as the blocks M2-1, M2-2, ..., M2-L filled with diagonal textures in FIG5 ) can be determined, where L is a positive integer. Each processing module and each reference module in FIG5 can have the same network structure.
[0097] For example, each reference module may include a neural network layer based on an attention mechanism, a fully connected layer, a linear layer, and other neural network layers to jointly implement feature extraction of the audio training sample V1. Each reference module may use the same network structure. Similarly, each processing module may also include the same neural network layer based on an attention mechanism, a fully connected layer, a linear layer, and other neural network layers as the reference module to jointly implement feature extraction of the masked audio training sample V1-1. Each reference module may use the same network structure, that is, the same network structure as the processing module.
[0098] It should be understood that in the example of Figure 5, information processing neural network model M1 includes L identically structured feature extraction processing modules, designed to more accurately capture the features of the audio training samples. In fact, each processing module is already a complete sub-neural network, capable of extracting features from the audio training samples and, if part of the audio training samples is missing, predicting the missing information.
[0099] Optionally, each processing module in the L processing modules or each reference module in the L reference modules may have a different network structure as needed.
[0100] In the information processing neural network model M1, the input of the lth processing module can be expressed as x l (As shown by the black solid points in Figure 5), the output can be expressed as f(xl , W l ), where x represents the eigenvector, W l is the network parameter of the lth processing module, l is a positive integer, and l≤L. In the example of FIG5 , the processing modules are in a series relationship, that is, the output of the lth processing module is the input of the l+1th processing module, that is, x l+1 =f(x l , W l ).
[0101] Similarly, in the reference neural network model M2, the input of the lth reference module can be expressed as x″ l , the output can be expressed as Where f(·) is the forward transfer function, is the network parameter of the lth reference module, l is a positive integer, and l≤L. In addition, in the example of FIG5 , each reference module is in a series relationship, that is, the output of the lth reference module is the input of the l+1th reference module, that is,
[0102] For the embodiment shown in Figure 5, each processing module can be trained separately without having to calculate the forward calculation results of each processing module, obtain the gradient of the loss function with respect to the parameters of each processing module in sequence through reverse calculation, and then update the parameters of the entire neural network according to the gradient.
[0103] For example, for the lth processing module among the L processing modules, the lth processing module can be trained based on the output result of the lth processing module and the output result of the reference module corresponding to the lth processing module, and the parameters of the lth processing module can be updated.
[0104] As shown in Figure 5, the reference modules corresponding to the lth processing module may include the lth reference module and the reference modules surrounding the lth reference module. For example, the reference modules corresponding to the lth processing module include the l-1th reference module, the lth reference module, and the l+1th reference module, where l-1 ≥ 1 and l+1 ≤ L. The reference modules corresponding to the 1st processing module may include the 1st reference module, and the reference modules corresponding to the Lth processing module may include the Lth reference module. Alternatively, the reference modules corresponding to the 1st processing module may include the 1st reference module and one or more reference modules following it, and the reference modules corresponding to the Lth processing module may include the Lth reference module and one or more reference modules preceding it.
[0105] An output reference result x′ can be determined based on the output result of the reference module corresponding to the lth processing module. l+1 (as shown by the cross in FIG5 ) for training the lth processing module. For example, when the reference modules corresponding to the lth processing module include the l-1th reference module, the lth reference module, and the l+1th reference module, the output result of the l-1th reference module, the output result of the lth reference module, and the output result of the l+1th reference module can be averaged, or weighted averaged (for example, the weight of the output result of the lth reference module can be set to be greater than the weights of the output results of the other two reference modules) to determine the reference result x′ corresponding to the lth processing module. l .
[0106] Then, based on the output reference result x′ corresponding to the lth processing module, l+1 and the output x of the lth processing module l+1 =f(x l , W l ) to determine the energy function for training the lth processing module.
[0107] The energy function E corresponding to the entire information processing neural network model can be calculated by formula (1):
[0108] E=E local +λE global (1)
[0109] Among them, E local is the local energy, and Among them, E local,l represents the local energy corresponding to the lth processing module, E globalis the global energy function, λ represents the degree of influence of global energy on total energy, 0<λ≤1. When only the optimization target of a single processing module is considered, λ=0.
[0110] According to an embodiment of the present disclosure, in order to train each processing module individually, the local energy function corresponding to the lth processing module can be used to train the lth processing module, wherein the local energy function corresponding to the lth processing module is used to evaluate the difference between the output result of the lth processing module and the output result of the corresponding reference module.
[0111] For example, considering the local optimization objective of the lth processing module itself and the local optimization objective affected by the global optimization objective common to all processing modules, the local energy function E corresponding to the lth processing module is local,l It can be calculated by formula (2):
[0112] Where B is the batch size, T represents the frame processed by the mask (for simplicity, the subscript is omitted here), D is the dimension of the feature vector x, Dec(·) represents the feature representation of the predicted mask part, represents the expected output of the lth processing module, λ PM and λ PC The value of is 0 or 1, and the two are opposite. PM When it is 1 (i.e. only considering the optimization target of the lth processing module), E local,l (hereinafter referred to as the first local energy function) represents the difference between the feature representation of the mask part predicted by the lth processing module and the feature representation obtained by encoding the mask part by the lth reference module. PC When E is 1 (i.e. considering the global optimization goal common to all processing modules), local,l (later represented by the second local energy function) represents the difference between the output result of the lth processing module and the expected output result of the lth reference module, where the expected output result of the lth reference module is determined based on the output result of the Lth processing module.
[0113] According to an embodiment of the present disclosure, the first local energy function corresponding to the lth processing module can be used to train the lth processing module, and then when the first local energy function corresponding to the lth processing module converges (it can be considered that ), updating the parameters of the lth processing module based on the second local energy function.
[0114] As shown in formula (3), the second local energy function can be based on the global energy function E global (That is, the feature representation of the mask part predicted by the Lth processing module is Dec(xL+1 ) and the output result x′ of the Lth reference module L+1 The second local energy function reflects the global optimization goal common to all processing modules.
[0115] The expected output of the above processing module l It can be based on the global energy function E global To determine, for example, the expected output result of the lth processing module can be determined by the following process
[0116] When the local energy function converges, the energy function has the characteristics shown in formula (4):
[0117] Therefore, it can be obtained that for the lth processing module,
[0118] Among them, ε l+1 Reverse calculation means starting from the Lth processing module and calculating forward in sequence (ie, in the order of the Lth processing module, the L-1th processing module, ... the lth processing module).
[0119] Furthermore, the reverse calculated difference may be determined for each processing module from the Lth processing module to the lth processing module in sequence, thereby propagating the difference of the Lth processing module to the lth processing module.
[0120] For example, for the l+kth processing module from the Lth processing module to the lth processing module, the output result f(x l+k ,W l+k ) Output result x of the l+k-1th processing module l+k The partial derivative of Then based on this partial derivative The reverse calculation difference ε between the output of the l+k+1th processing module l+k+1 Determine the reverse calculation difference ε of the output result of the l+kth processing module l+k , where k is an integer and satisfies k≥0, l+k+1≤L.
[0121] That is, after deduction, the reverse calculation difference of the output result of the l+kth processing module can be determined by formula (6). Get ε l+k .
[0122] The reverse calculation difference ε of the output result of the lth processing module is obtained based on formula (6) l+1 Then, the difference ε can be calculated based on the output result of the lth processing module. l+1 and the output result of the lth processing module Determine the expected output result of the lth processing module For example, in formula (7), based on and ε l+1 The difference is obtained in, Represents the output of the lth processing module when the first local energy function converges.
[0123] The process of updating the parameters of the lth processing module based on the second local energy function can be implemented based on formula (8).
[0124] Among them, W l is the parameter of the lth processing module. It can be seen in formula (8) that the parameter W of the second local energy function Elocal for the lth processing module is calculated as l The gradient is then used to update the parameters of the lth processing module.
[0125] Furthermore, when the parameters of the lth processing module are determined, the parameters of the lth reference module may be updated based on the parameters of the lth processing module.
[0126] For example, referring to formula (9), the exponential moving average of the parameters of the processing module in at least one previous iteration can be used to update the parameters of the reference module.
[0127] Among them, 0≤τ≤1. It can be seen that the parameters of the reference module Associated with historical results of processing module parameters.
[0128] After completing the training of the information processing neural network model according to the above process, the information processing neural network model can be used to extract audio features, or predict (or repair) missing parts (or unclear parts) of the audio.
[0129] Optionally, according to the examples of Figures 3A, 4B to 4C, and 5, the present disclosure further discloses a method for training a neural network model for processing audio. Optionally, the neural network model for processing audio is an example of the above-mentioned information processing neural network model. The method includes: initializing a neural network model for processing audio and a reference neural network model corresponding to the neural network model for processing audio, wherein the neural network model for processing audio includes multiple processing modules and the reference neural network model includes multiple reference modules; updating the parameters of the neural network model for processing audio and the reference neural network model through multiple iterations, wherein, in each iteration, based on an audio training sample and the parameters of the multiple reference modules, the audio features corresponding to the multiple reference modules are determined; based on a mask sample obtained after masking the audio training sample and the parameters of the multiple processing modules, the audio features corresponding to the multiple processing modules are determined; based on the audio features corresponding to the multiple processing modules and the audio features corresponding to the multiple reference modules, the parameters of the multiple processing modules are updated; and based on the updated parameters of the multiple processing modules, the parameters of the multiple reference modules are updated. Then, optionally, the trained neural network model for processing audio can be used to extract features of the audio data to further complete speech recognition tasks or sentiment analysis tasks, etc. In addition, the audio data can also be repaired by the neural network model for processing audio.
[0130] From the above description of Figures 3A to 5, it can be seen that the method of training a neural network model disclosed in the present invention can train each processing module in the information processing neural network model separately. This process does not require clarifying the gradient of the loss function with respect to the parameters of other processing modules as in the traditional back-propagation algorithm. Therefore, the difficulty of training the neural network model is reduced, and each processing module can be trained in parallel, thereby effectively improving the training efficiency of the neural network model.
[0131] Because each processing module in the information processing neural network model can be trained independently, there is no need to share network parameters between the processing modules. Therefore, the method of training the neural network model disclosed in the present invention has good confidentiality and can better protect the parameters of each processing module and prevent the parameters from being stolen. Therefore, the method of training the neural network model disclosed in the present invention has obvious advantages for application scenarios with high confidentiality requirements (for example, involving trade secrets, personal privacy, etc.).
[0132] The method for training a neural network model disclosed herein can effectively reduce the amount of computation performed by a computer, save computer resources, and fully utilize computer resources to implement parallel training of multiple processing modules, thereby reducing the training time of the neural network model. Since the method for training a neural network model disclosed herein can train each processing module separately, the training efficiency is high, and thus it can be better applied to training scenarios of large neural network models or real-time training scenarios of neural network models (i.e., training is performed while task processing is performed, rather than the task processing process being completely independent of the training process).
[0133] For the method of training a neural network model disclosed in the present invention, the training of each processing module can be performed by a different server. During the training process, there is no need to transmit respective network parameters between the servers, which effectively reduces the amount of data that needs to be transmitted between the servers, thereby reducing the requirements for server performance and reducing the requirements for communication bandwidth during the service.
[0134] In fact, in the present disclosure, the method of individually training each processing module in the information processing neural network model is closer to the human brain's information processing process (that is, each neuron processes information individually, and its information processing process only involves the input or output of adjacent neurons, and does not involve multiple neurons transmitting information back in sequence), and is therefore more capable of producing an intelligent machine that can respond in a manner similar to human intelligence.
[0135] FIG6 is a schematic flowchart illustrating a method 600 for performing information processing based on a neural network model according to an embodiment of the present disclosure.
[0136] In step S610, information to be processed is obtained.
[0137] The information to be processed may include one or more of image information, text information, audio information, and video information. That is, method 600 can be used to process a single type of data (e.g., machine translation processing only text information) or to process multiple types of data simultaneously (e.g., performing pathology analysis based on both medical images and medical reports).
[0138] In step S620, the information to be processed is processed based on the information processing neural network model to obtain a result of processing the information to be processed.
[0139] The information processing neural network model can be trained using method 300 as shown in Figures 3A-3B. The information processing neural network model can be trained based solely on training samples and mask samples to perform information processing tasks such as feature extraction and missing information prediction. Alternatively, the information processing neural network model can be further trained for downstream information processing tasks based on the training samples of the downstream information processing tasks. The information processing neural network model further trained for downstream information processing tasks can be used to perform downstream information processing tasks such as information extraction, information classification, information restoration, information style transfer, information enhancement, information mining, and information recognition.
[0140] After obtaining the result of processing the information to be processed based on step S620, the processing result can be displayed on the terminal 120 shown in Figure 1. Optionally, as needed, the server 110 or terminal 120 shown in Figure 1 can further analyze or display the processing result.
[0141] FIG7 is a schematic diagram illustrating an information processing process based on a neural network model according to an embodiment of the present disclosure.
[0142] As shown in FIG7 , the information processing process based on the neural network model according to an embodiment of the present disclosure includes a training phase of the neural network model and a testing phase of the neural network model (or a usage phase of the neural network model).
[0143] During the training phase of the neural network model, an information processing neural network model can be constructed first. Then, the structure and parameters of the reference neural network model corresponding to the information processing neural network model can be determined based on the structure and parameters of the information processing neural network model. For example, assuming that the information processing neural network model includes L processing modules, the reference neural network model corresponding to the information processing neural network model can include L reference modules, and the lth processing module in the L processing modules and the lth reference module in the L reference modules can have the same structure, where L and l are positive integers, and l≤L. Optionally, the initial parameters of the information processing neural network model and the initial parameters of the corresponding reference neural network model can be initialized based on random numbers.
[0144] During the training process, training samples may be obtained and used to train the information processing neural network model and the reference neural network model. The training samples may include image training samples, text training samples, audio training samples, video training samples, or a combination thereof. The training process includes multiple iterations of the parameters of the information processing neural network model and the reference neural network model.
[0145] Specifically, in each iteration, the output results corresponding to the multiple reference modules can be determined based on the training samples and the parameters of the multiple reference modules; the output results corresponding to the multiple processing modules can be determined based on the mask samples obtained after mask processing of the training samples and the parameters of the multiple processing modules; then, based on the output results corresponding to the multiple processing modules and the output results corresponding to the multiple reference modules, the parameters of the multiple processing modules are updated; and the parameters of the multiple reference modules are updated based on the updated parameters of the multiple processing modules (for example, in each iteration, the parameters of the multiple reference modules can be updated using the values of the parameters of the multiple processing modules in at least one previous iteration).
[0146] After each iterative training is completed, it can be determined whether the current training process meets the predetermined conditions. If the current training process meets the predetermined conditions, the training of the information processing neural network model is confirmed to be completed and the information processing neural network model is saved. If the previous training process does not meet the predetermined conditions, the information processing neural network model and the corresponding reference neural network model are continued to be trained using the training samples, and the parameters of the information processing neural network model and the corresponding reference neural network model are updated.
[0147] It should be understood that the predetermined condition can be in various forms. For example, the predetermined condition can be reaching a predetermined number of training times (for example, 1000 times, but not limited thereto. It should be noted that each training in the predetermined number of training times here refers to an epoch of training, not a batch of training); the predetermined condition can also be the convergence of an energy function, wherein the energy function is used to evaluate the accuracy of the output results of the multiple processing modules; or the predetermined condition can also be simultaneously meeting the two conditions of reaching the predetermined number of training times and the convergence of the energy function; or the predetermined condition can also be meeting either of the two conditions of reaching the predetermined number of training times and the convergence of the energy function. Optionally, the energy function can be a global energy function for evaluating the difference between the output result of the Lth processing module and the output result of the Lth reference module, or a local energy function for evaluating the difference between the output result of the lth processing module and the output result of the reference module corresponding to the lth processing module, or it can be determined based on the global energy function and the local energy function.
[0148] By presetting the number of training times and stopping the training of the information processing neural network model after reaching the pre-set number of training times, it is possible to prevent the network from overfitting, or the training time from being too long and the network optimization effect from being unobvious.
[0149] During the testing phase of the information processing neural network model, the information to be processed can be provided to a computer. The computer loads the trained information processing neural network model, processes the information to be processed using the trained information processing neural network model, and outputs the results for the user's reference. Optionally, the user can determine whether further training or optimization of the information processing neural network model is necessary based on the information processing results.
[0150] Similar to training samples, the information to be processed can include images, text, audio, video, or a combination thereof. Information processing neural network models can be used for feature extraction, missing information prediction, information enhancement, information mining, and more.
[0151] Similarly, the actual information processing process (i.e., the process of using the information processing neural network model) is similar to the testing phase of the information processing neural network model, so it will not be repeated here.
[0152] It should be noted that the training phase of the information processing neural network model shown in FIG7 and the testing phase (or use phase) of the information processing neural network model can be performed independently, that is, the information processing neural network model is trained first, and after the training of the information processing neural network model is completed, the information processing neural network model is tested or used. In addition, the training phase of the information processing neural network model shown in FIG7 and the testing phase (or use phase) of the information processing neural network model can also be performed alternately. For example, training can be performed while task processing is performed, and the non-task processing process is completely independent of the training process. Therefore, the method for training a neural network model disclosed in the present invention can be better applied to real-time training scenarios of neural network models.
[0153] Through testing and verification, the disclosed information processing neural network model training method can independently train each processing module in the information processing neural network model, and each processing module can be trained in parallel, effectively improving the training efficiency of the neural network model and reducing the training time of the neural network model. Compared with existing neural network model training methods based on backpropagation, the disclosed neural network model training method can effectively avoid the collapse problem during neural network training.
[0154] For example, as noted in related experiments, the data2vec2 model, which uses backpropagation for self-supervised training, often experiences collapse during training (for example, the feature vectors obtained after all training samples are processed by the neural network are similar and fail to reflect the characteristics of different training samples). Compared to the data2vec2 model, the method disclosed herein has not experienced collapse in multiple tests and validations. In other words, the neural network model training method disclosed herein has excellent stability.
[0155] For another example, the information processing neural network model can be initially trained using the LS-100from960h dataset, and then retrained using the LS-10from100h dataset to test the performance of the neural network model training method disclosed herein and the method for self-supervised training based on backpropagation. Through testing and verification, the neural network model training method disclosed herein significantly improves both model training speed and model processing accuracy compared to the method for self-supervised training based on backpropagation.
[0156] The neural network training method disclosed in the present invention can improve the accuracy and efficiency of feature extraction of samples. When the model trained based on this method is used to perform downstream information processing tasks, the task processing accuracy and task processing speed are also significantly improved.
[0157] FIG8 is a schematic diagram 800 showing the composition of an apparatus 800 for training a neural network model according to an embodiment of the present disclosure.
[0158] According to an embodiment of the present disclosure, the apparatus 800 for training a neural network model may include: an initialization module 810 and a parameter updating module 820 .
[0159] Among them, the initialization module 810 can be configured to: initialize the information processing neural network model and the reference neural network model corresponding to the information processing neural network model, wherein the information processing neural network model includes multiple processing modules and the reference neural network model includes multiple reference modules.
[0160] According to an embodiment of the present disclosure, the multiple processing modules may be L processing modules, the multiple reference modules may be L reference modules, the lth processing module among the L processing modules and the lth reference module among the L reference modules have the same structure, wherein L and l are positive integers, and l≤L.
[0161] The parameter updating module 820 may be configured to update the parameters of the information processing neural network model and the reference neural network model through multiple iterations.
[0162] According to an embodiment of the present disclosure, in each iteration, the parameter updating module 820 can determine the output results respectively corresponding to the multiple reference modules based on the training samples and the parameters of the multiple reference modules; determine the output results respectively corresponding to the multiple processing modules based on the mask samples obtained after mask processing of the training samples and the parameters of the multiple processing modules; update the parameters of the multiple processing modules based on the output results respectively corresponding to the multiple processing modules and the output results respectively corresponding to the multiple reference modules; and then update the parameters of the multiple reference modules based on the updated parameters of the multiple processing modules.
[0163] According to an embodiment of the present disclosure, for the lth processing module among the L processing modules, the parameters of the lth processing module can be updated based on the output result of the lth processing module and the output result of the reference module corresponding to the lth processing module, wherein the reference module corresponding to the lth processing module includes the lmth reference module to the l+nth reference module, wherein m and n are integers and satisfy m≥0, n≥0, lm≥1, l+n≤L.
[0164] According to an embodiment of the present disclosure, during the parameter update process of the multiple processing modules, the value of an energy function can be calculated based on the output results corresponding to the multiple processing modules and the output results corresponding to the multiple reference modules, and the parameters of the multiple processing modules can be updated based on the value of the energy function, wherein the energy function is used to evaluate the accuracy of the output results of the multiple processing modules.
[0165] The apparatus 800 for training a neural network model can be used for both supervised training of the information processing neural network model and self-supervised training of the information processing neural network model.
[0166] It should be understood that the apparatus 800 for training a neural network model shown in FIG8 can implement various methods for training a neural network model as described with respect to FIG3A-3B .
[0167] FIG9 is a schematic diagram showing the composition of an apparatus 900 for performing information processing based on a neural network model according to an embodiment of the present disclosure.
[0168] According to an embodiment of the present disclosure, the apparatus 900 for performing information processing based on a neural network model may include: an information acquisition module 910 and an information processing module 920 .
[0169] The information acquisition module 910 may be configured to: acquire information to be processed, wherein the information to be processed includes at least one of image information, text information, audio information, and video information.
[0170] The neural network model 920 for generating interactive information may be configured to process the information to be processed based on the information processing neural network model to obtain a result of processing the information to be processed.
[0171] It should be understood that the apparatus 900 for performing information processing based on a neural network model shown in FIG9 can implement various methods for performing information processing based on a neural network model as described with respect to FIG6. The information processing neural network model can be trained by the method 300 shown in FIG3A-3B.
[0172] The apparatus 900 for performing information processing based on a neural network model may be located on the server 110 shown in FIG. 1 or on the terminal 120 shown in FIG. 1 .
[0173] In general, various example embodiments of the present disclosure may be implemented in hardware or dedicated circuitry, software, firmware, logic, or any combination thereof. Certain aspects may be implemented in hardware, while other aspects may be implemented in firmware or software that may be executed by a controller, microprocessor, or other computing device. When various aspects of the embodiments of the present disclosure are illustrated or described as block diagrams, flow charts, or using some other graphical representation, it will be understood that the blocks, devices, systems, techniques, or methods described herein may be implemented, as non-limiting examples, in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or a controller or other computing device, or some combination thereof.
[0174] For example, the method or apparatus according to an embodiment of the present disclosure may also be implemented with the aid of the architecture of the computing device 3000 shown in FIG10 . As shown in FIG10 , the computing device 3000 may include a bus 3010, one or more CPUs 3020, a read-only memory (ROM) 3030, a random access memory (RAM) 3040, a communication port 3050 connected to a network, an input / output component 3060, a hard disk 3070, and the like. The storage device in the computing device 3000, such as the ROM 3030 or the hard disk 3070, may store various data or files used for processing and / or communication of the method provided by the present disclosure, as well as program instructions executed by the CPU. The computing device 3000 may also include a user interface 3080. Of course, the architecture shown in FIG10 is merely exemplary. When implementing different devices, one or more components in the computing device shown in FIG10 may be omitted according to actual needs.
[0175] According to another aspect of the present disclosure, a computer-readable storage medium is also provided. Computer-readable instructions are stored on the computer storage medium. When the computer-readable instructions are executed by a processor, the method according to the embodiment of the present disclosure described with reference to the above figures can be executed. The computer-readable storage medium in the embodiment of the present disclosure can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM). It should be noted that memory of the methods described herein is intended to include, but is not limited to, these and any other suitable types of memory. It should be noted that memory of the methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0176] Embodiments of the present disclosure also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform a method according to an embodiment of the present disclosure.
[0177] In summary, the embodiments of the present disclosure provide a method, apparatus, computer program product, and storage medium for training a neural network model, the method comprising: initializing an information processing neural network model and a reference neural network model corresponding to the information processing neural network model, wherein the information processing neural network model comprises a plurality of processing modules, and the reference neural network model comprises a plurality of reference modules; updating the parameters of the information processing neural network model and the reference neural network model through multiple iterations, wherein, in each iteration, based on the training sample and the parameters of the plurality of reference modules, the output results corresponding to the plurality of reference modules are determined; based on the mask sample obtained after masking the training sample and the parameters of the plurality of processing modules, the output results corresponding to the plurality of processing modules are determined; based on the output results corresponding to the plurality of processing modules and the output results corresponding to the plurality of reference modules, the parameters of the plurality of processing modules are updated; and the parameters of the plurality of reference modules are updated based on the updated parameters of the plurality of processing modules.
[0178] Since the method for training a neural network model disclosed herein can train each processing module in the information processing neural network model individually, and each processing module can be trained in parallel, the training efficiency of the neural network model can be effectively improved. The method for training a neural network model disclosed herein can train the processing module based solely on the output results of the processing module and the output results of the reference module corresponding to the processing module. This process does not require clarifying the gradient of the loss function with respect to the parameters of other processing modules, thereby reducing the difficulty of training the neural network model, effectively saving computer resources, and reducing the requirements for computer performance.
[0179] At the same time, because each processing module in the information processing neural network model can be trained independently, there is no need for the processing modules to share their respective network parameters. Therefore, the method of training the neural network model disclosed in the present invention has good confidentiality and can better protect the parameters of each processing module and prevent the parameters from being stolen. Therefore, the method of training the neural network model disclosed in the present invention has obvious advantages for application scenarios with high confidentiality requirements.
[0180] The disclosed method for training a neural network model can effectively reduce the amount of computation required by a computer, fully utilizing computer resources to implement parallel training of multiple processing modules, thereby reducing the training time of the neural network model. Because the disclosed method for training a neural network model can train each processing module separately, the training efficiency is high, and therefore it can be better applied to training scenarios of large neural network models or real-time training scenarios of neural network models.
[0181] For the method of training a neural network model disclosed in the present invention, the training of each processing module can be performed by a different server. During the training process, there is no need to transmit respective network parameters between the servers, which effectively reduces the amount of data that needs to be transmitted between the servers, thereby reducing the requirements for server performance and reducing the requirements for communication bandwidth during the service.
[0182] In addition, compared with the existing neural network model training method based on backpropagation, the neural network model training method disclosed in the present invention can stably train the neural network model and effectively avoid the collapse problem during the neural network training process.
[0183] In fact, in the present disclosure, the method of individually training each processing module in the information processing neural network model is closer to the human brain's information processing process (that is, each neuron processes information individually, and its information processing process only involves the input or output of adjacent neurons, and does not involve multiple neurons transmitting information back in sequence), and is therefore more capable of producing an intelligent machine that can respond in a manner similar to human intelligence.
[0184] Through testing and verification, the neural network model training method disclosed in the present invention has greatly improved the model training speed and the accuracy of model processing information compared with the method of self-supervised training based on back propagation.
[0185] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of the code, and the module, program segment, or a part of the code contains at least one executable instruction for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0186] This disclosure uses specific terms to describe the embodiments of the present disclosure. For example, "first / second embodiment," "one embodiment," and / or "some embodiments" refer to a certain feature, structure, or characteristic associated with at least one embodiment of the present disclosure. Therefore, it should be emphasized and noted that "one embodiment," "an embodiment," or "an alternative embodiment" mentioned two or more times in different locations in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures, or characteristics in one or more embodiments of the present disclosure may be appropriately combined.
[0187] Unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It should also be understood that terms such as those defined in common dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant technology and should not be interpreted in an idealized or highly formal sense, unless expressly defined as such herein.
[0188] The above is an illustration of the present invention and should not be considered as limiting thereof. Although several exemplary embodiments of the present invention have been described, it will be readily understood by those skilled in the art that many modifications may be made to the exemplary embodiments without departing from the novel teachings and advantages of the present invention. Therefore, all such modifications are intended to be included within the scope of the present invention as defined by the claims. It should be understood that the above is an illustration of the present invention and should not be considered as being limited to the specific embodiments disclosed, and modifications to the disclosed embodiments and other embodiments are intended to be included within the scope of the appended claims. The present invention is defined by the claims and their equivalents.
Claims
1. A method for training a neural network model, comprising: Initializing an information processing neural network model and a reference neural network model corresponding to the information processing neural network model, wherein the information processing neural network model includes a plurality of processing modules and the reference neural network model includes a plurality of reference modules; The parameters of the information processing neural network model and the reference neural network model are updated through multiple iterations, wherein in each iteration, Based on the training samples and the parameters of the multiple reference modules, the output results corresponding to the multiple reference modules are obtained by inputting the training samples into the multiple reference modules for forward calculation and outputting the corresponding calculation results respectively; Based on the mask sample obtained after performing mask processing on the training sample and the parameters of the multiple processing modules, the output results corresponding to the multiple processing modules are obtained by inputting the mask sample into the multiple processing modules for forward calculation and outputting the corresponding calculation results respectively; Based on the output results respectively corresponding to the multiple processing modules and the output results respectively corresponding to the multiple reference modules, updating the parameters of the multiple processing modules; and The parameters of the plurality of reference modules are updated based on the updated parameters of the plurality of processing modules.
2. The method of claim 1, wherein: Updating the parameters of the plurality of reference modules based on the updated parameters of the plurality of processing modules comprises: The parameters of the plurality of reference modules are updated using the values of the parameters of the plurality of processing modules in at least one previous iteration.
3. The method of claim 2, wherein: Updating the parameters of the multiple reference modules by using the values of the parameters of the multiple processing modules in at least one previous iteration includes: The parameters of the plurality of reference modules are updated by using the exponential moving average of the parameters of the plurality of processing modules in at least one previous iteration.
4. The method according to any one of claims 1 to 3, wherein: The multiple processing modules are L processing modules, the multiple reference modules are L reference modules, and the lth processing module among the L processing modules has the same structure as the lth reference module among the L reference modules, wherein L and l are positive integers, and l≤L.
5. The method of claim 4, wherein: Based on the output results respectively corresponding to the multiple processing modules and the output results respectively corresponding to the multiple reference modules, updating the parameters of the multiple processing modules includes: For the lth processing module among the L processing modules, The parameters of the lth processing module are updated based on the output result of the lth processing module and the output result of the reference module corresponding to the lth processing module, wherein the reference module corresponding to the lth processing module includes the lmth reference module to the l+nth reference module, wherein m and n are integers and satisfy m≥0, n≥0, lm≥1, l+n≤L.
6. The method according to claim 4 or 5, wherein: Based on the output results respectively corresponding to the multiple processing modules and the output results respectively corresponding to the multiple reference modules, updating the parameters of the multiple processing modules includes: The value of an energy function is calculated based on the output results respectively corresponding to the multiple processing modules and the output results respectively corresponding to the multiple reference modules, and the parameters of the multiple processing modules are updated based on the value of the energy function, wherein the energy function is used to evaluate the accuracy of the output results of the multiple processing modules.
7. The method of claim 6, wherein: The energy function includes a global energy function and a local energy function. Among them, the global energy function is used to evaluate the difference between the output result of the Lth processing module and the output result of the Lth reference module, and the local energy function is used to evaluate the difference between the output result of the lth processing module and the output result of the reference module corresponding to the lth processing module.
8. The method of claim 7, wherein: The local energy function includes: a first local energy function and a second local energy function, Calculating the value of the energy function based on the output results respectively corresponding to the multiple processing modules and the output results respectively corresponding to the multiple reference modules includes: For the lth processing module among the L processing modules, determining a value of the first local energy function based on a difference between an output result of the lth processing module and an output result of a reference module corresponding to the lth processing module; Determining an expected output result of the lth processing module based on the global energy function; and The value of the second local energy function is determined based on a difference between an output result of the lth processing module and an expected output result of the lth processing module.
9. The method of claim 8, wherein: Determining the expected output result of the lth processing module based on the global energy function includes: Determining a reverse calculation difference of an output result of the lth processing module based on the value of the global energy function; and Based on the reverse calculation difference of the output result of the lth processing module and the output result of the lth processing module, the expected output result of the lth processing module is determined.
10. The method of claim 9, wherein: Determining the reverse calculation difference of the output result of the lth processing module based on the value of the global energy function includes: For the l+kth processing module from the Lth processing module to the lth processing module, Calculating the partial derivative of the output result of the l+kth processing module with respect to the output result of the l+k-1th processing module, wherein the output result of the l+k-1th processing module is the input of the l+kth processing module; and The reverse calculation difference of the output result of the l+kth processing module is determined based on the reverse calculation difference of the partial derivative and the output result of the l+k+1th processing module, where k is an integer and satisfies k≥0, l+k+1≤L.
11. The method according to any one of claims 8 to 10, wherein updating the parameters of the plurality of processing modules comprises: Performing weighted calculation on the first local energy function and the second local energy function corresponding to the lth processing module to obtain a third local energy function, and The parameters of the lth processing module are updated based on the third local energy function.
12. The method according to any one of claims 8 to 11, wherein updating the parameters of the plurality of processing modules comprises: When the first local energy function corresponding to the lth processing module has not converged, updating the parameters of the lth processing module based on the value of the first local energy function corresponding to the lth processing module; as well as When the first local energy function corresponding to the lth processing module converges, the parameters of the lth processing module are updated based on the second local energy function corresponding to the lth processing module.
13. The method according to any one of claims 1 to 12, wherein: Each processing module in the plurality of processing modules, or each reference module in the plurality of reference modules is a sub-neural network model or a neural network layer, Among them, each processing module or each reference module includes: one or more of: a convolutional neural network, a neural network based on an attention mechanism, a recurrent neural network, a recursive neural network, a feedforward neural network, a generative adversarial neural network, and a deep neural network.
14. The method according to any one of claims 1 to 13, wherein: The method is used to perform supervised training on the information processing neural network model or to perform self-supervised training on the information processing neural network model.
15. The method according to any one of claims 1 to 14, wherein: The masking of the training samples comprises: performing at least one of masking of different sizes, masking of different positions, and masking of different shapes on the training samples. The training samples include at least one of image training samples, text training samples, audio training samples, and video training samples.
16. The method according to any one of claims 1 to 15 further comprises: When the updated information processing neural network model meets a predetermined condition, completing the training of the information processing neural network model and obtaining a trained information processing neural network model; as well as The trained information processing neural network model is further trained using information processing training samples corresponding to information processing tasks, wherein the information processing tasks include at least one of information extraction, information classification, information restoration, information style transfer, information enhancement, information mining, and information recognition.
17. A method for information processing based on a neural network model, comprising: Acquiring information to be processed, wherein the information to be processed includes at least one of image information, text information, audio information, and video information, The information to be processed is processed based on an information processing neural network model to obtain a result of processing the information to be processed, wherein the information processing neural network model is trained by the method described in any one of claims 1-16.
18. A device for training a neural network model, comprising: An initialization module is configured to: initialize an information processing neural network model and a reference neural network model corresponding to the information processing neural network model, wherein the information processing neural network model includes a plurality of processing modules, and the reference neural network model includes a plurality of reference modules; The parameter updating module is configured to update the parameters of the information processing neural network model and the reference neural network model through multiple iterations, wherein in each iteration, Based on the training samples and the parameters of the multiple reference modules, the output results corresponding to the multiple reference modules are obtained by inputting the training samples into the multiple reference modules for forward calculation and outputting the corresponding calculation results respectively; Based on the mask sample obtained after performing mask processing on the training sample and the parameters of the multiple processing modules, the output results corresponding to the multiple processing modules are obtained by inputting the mask sample into the multiple processing modules for forward calculation and outputting the corresponding calculation results respectively; Based on the output results respectively corresponding to the multiple processing modules and the output results respectively corresponding to the multiple reference modules, updating the parameters of the multiple processing modules; and The parameters of the plurality of reference modules are updated based on the updated parameters of the plurality of processing modules.
19. A computer program product, comprising computer software code, which, when executed by a processor, is used to implement the method according to any one of claims 1 to 17.
20. A computer-readable storage medium having computer-executable instructions stored thereon, wherein the instructions are used to implement the method according to any one of claims 1 to 17 when executed by a processor.
21. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 17 through the computer program.
Citation Information
Patent Citations
Federal learning model training method, client, server and storage medium
CN113298229A
Distillation method and device of neural network model and electronic system
CN114037046A
Image restoration method and device, equipment, storage medium and program product
CN115908188A
Network training method and device, electronic equipment and storage medium
CN116050498A
Method and device for training neural network model
CN116957071A