Method for compressing an artificial neural network

By compressing neural networks through synaptic coefficient selection and optimized projection functions, the method addresses memory and computational limitations, allowing efficient implementation on resource-limited devices with enhanced performance.

FR3117646B1Inactive Publication Date: 2024-09-27COMMISSARIAT A LENERGIE ATOMIQUE ET AUX ENERGIES ALTERNATIVES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
FR2020013166
Authority / Receiving Office
FR · FR
Patent Type
Patents
Current Assignee / Owner
Filing Date
2020-12-14
Publication Date
2024-09-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The implementation of large artificial neural networks on devices with limited resources is hindered by memory and computational constraints, leading to degraded learning performance.

Method used

A method for compressing a large neural network into a smaller one by selecting predominant synaptic coefficients, quantifying them, and applying Huffman coding, while optimizing projection functions in a reduced dimension subspace during the learning process of a student network to match the performance of the teacher network.

Benefits of technology

The method reduces the network size and computational requirements without affecting operation efficiency, enabling effective implementation on resource-constrained devices with improved performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000020_0000
    Figure 00000020_0000
  • Figure 00000021_0000
    Figure 00000021_0000
  • Figure 00000022_0000
    Figure 00000022_0000
Patent Text Reader

Abstract

Method for reducing the size of a teacher network to obtain a student network, the method comprising the steps of: Training (201) the teacher network to solve a first given problem for a first training dataset; After training the teacher network, extracting the output features of the teacher network layer; For at least one intermediate layer of the student network, initializing a projection function in a kl-dimensional subspace; Training (203) the student network on a second training dataset to jointly solve the first problem and a second problem of reconstructing the extracted features of the teacher network projected into the kl-dimensional subspaces defined by the projection functions; The parameters of the projection functions being learned during the training of the student network jointly with the parameters of the student network. Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

Title of the invention: Method for compressing an artificial neural network

[0001] The invention relates to the field of artificial neural networks and more specifically their implementation on devices with limited resources.

[0002] The invention proposes a method for reducing the size of a large artificial neural network to facilitate its implementation. In other words, the proposed method consists of compressing a large network to obtain a smaller network capable of solving the same problem with similar performance.

[0003] The invention thus proposes a method for constructing a lower-dimensional neural network with performance equal to or greater than that of a higher-dimensional neural network, in terms of memory usage. Consequently, the resulting network is inherently less demanding in terms of memory and computational resources for inference. Once constructed, such a network can be implemented in electronic devices that are limited in terms of memory and computational resources.

[0004] Artificial neural networks are among the most effective models for solving complex problems, particularly classification and regression problems. The parameters of these models are generally obtained through machine learning methods based on backpropagation and stochastic gradient descent algorithms. A neural network typically consists of several layers of interconnected neurons. Each neuron in a layer is connected to one or more neurons in a subsequent layer and a preceding layer via synapses defined by a synaptic weight.

[0005] The performance of a neural network is generally related to its size, that is, the number of layers and the number of neurons per intermediate or hidden layer. The larger this number, the more complex the problems the network will be able to solve.

[0006] However, the number of parameters to manage and operations to perform is also directly related to the size of the network. Thus, implementing a large network on a computing device with limited resources is made difficult by limitations in terms of computing capacity, storage capacity, and bandwidth.

[0007] There is therefore a problem to be solved in order to allow the implementation of a large neural network on a computing device with limited resources without significantly degrade the network's learning performance.

[0008] Document [1] presents a method for compressing a neural network model which aims to reduce the volume of data to be saved when running such a network.

[0009] The proposed method is based on selecting the predominant synaptic coefficients, quantifying them, and applying Huffman coding. It reduces the size and quantity of network parameters to be saved but does not affect the reduction in the number of operations to be performed, which remains dependent on the number of neurons per layer.

[0010] Other solutions, such as those described in documents [2] or [3], are based on the implementation of a small student network, trained to solve the same problem as a large teacher network, using certain information acquired after training the teacher network.

[0011] One drawback of these methods is that the performance of the student network depends on the ratio of the respective sizes of the teacher and student networks. Indeed, the greater the difference between the sizes of the two networks, the less reliable the performance of the student network will be.

[0012] The French patent application filed by the Applicant under application number FR 2005884 describes a method for reducing the dimensionality of a teaching neural network to build a student network.

[0013] This method provides a first solution to the problem of compressing large networks, but the solving performance of the student network can still be increased by improving the optimization of its learning.

[0014] The invention proposes an improvement to the network compression method described in French patent FR 2005884 by including, in the optimization, the parameters of the projection function in a subspace of reduced dimension compared to the space of the teacher network. These parameters are integrated into the training of the student neural network so as to best learn the projection function and improve the solving performance of the student network so that it approaches as closely as possible that of the teacher network.

[0015] The proposed method is based on an optimization approach by learning parametric functions allowing the transition from a given large neural network (the teacher network) to a smaller neural network (the student network) which solves the initial task of the teacher network as well as the optimization of the parametric transition functions between the two networks.

[0016] The invention relates to a computer-implemented method for reducing the size of a first artificial neural network, called the teacher network, in order to obtain a second, smaller artificial neural network, called the student network. including the steps of: - Train the teaching network to solve a first given problem for an initial set of training data organized as several data vectors, - After training the teacher network, for each data vector and for at least one intermediate layer of the teacher network, extract the output characteristics of the teacher network layer as a vector having a first dimension pb - For at least one intermediate layer of the student network, initialize a projection function in a subspace of dimension ki strictly less than the first dimension pb - Train the student network on a second dataset learning to jointly solve the first problem and a second problem of reconstructing the features extracted from the teacher network projected into the subspaces of dimensions ki defined by the projection functions, - The parameters of the projection functions are learned during the training of the student network in conjunction with the parameters of the student network.

[0017] According to a particular aspect of the invention, the second training dataset consists of all or part of the first training dataset or consists of data semantically similar to the data in the first training dataset.

[0018] According to a particular aspect of the invention, the projection functions are projection matrices of dimensions (pbki).

[0019] According to a particular aspect of the invention, the projection functions are neural networks with at least two layers and at least one non-linear activation function between each pair of successive layers.

[0020] In one embodiment, the method according to the invention further comprises, after training the teacher network, for each data vector and for at least one intermediate layer of the teacher network, a principal component analysis applied to the feature vectors to determine the dimension ki of the projection subspace.

[0021] According to a particular aspect of the invention, the principal component analysis comprises the following substeps: - Calculate the covariance matrix Ci of the characteristic vectors of dimension pb Determine the eigenvalues ​​of the covariance matrix Ci, - Determine the dimension ki of the projection subspace as the smallest possible integer value for which the ratio between the sum of the ki dominant eigenvalues ​​and the total sum of eigenvalues ​​is greater than or equal to a predetermined threshold.

[0022] According to a particular aspect of the invention, the projection matrices are initialized to matrices containing the ki dominant eigenvectors of the covariance matrix G.

[0023] According to a particular aspect of the invention, the first problem is associated with a first predetermined objective function to be minimized and the second problem is associated with a second objective function to be minimized defined as the mean squared error between the output characteristics of the intermediate layers of the student network and the output characteristics of the respective intermediate layers of the teacher network projected onto the ki dimension subspace via the projection function.

[0024] According to a particular aspect of the invention, in order to jointly solve the first problem and the second problem, the training of the student network is carried out so as to determine the parameters of the student network and of the projection function which minimize the sum of the first objective function and the second objective function.

[0025] According to a particular aspect of the invention, wherein the training data is image, audio, video, multimedia or textual data.

[0026] The invention also relates to a computing device configured to implement an artificial student neural network obtained from an artificial teacher neural network by applying the method according to the invention.

[0027] The invention further relates to a computer program comprising instructions for executing the method according to the invention, when the program is executed by a processor, and to a processor-readable recording medium on which is recorded a program comprising instructions for executing the method according to the invention, when the program is executed by a processor.

[0028] Other features and advantages of the present invention will become more apparent from the following description in relation to the following accompanying drawings.

[0029] [fig. 1] Figure [fig. 1] represents a diagram of an example of an artificial neural network,

[0030] [fig.2] Fig.2 represents a flowchart detailing the implementation steps of the method according to the invention,

[0031] [fig.3] Fig.3 illustrates, in a flowchart, the sequence of the reduction step of network dimensions according to one embodiment of the invention,

[0032] [fig.4a] Fig.4a illustrates a first example of comparative results obtained with the invention and two other methods,

[0033] [fig.4b] the [fig.4b] illustrates a second example of comparative results obtained with the invention and two other methods.

[0034] Figure 1 represents a general diagram of an artificial neural network, for example, a fully connected convolutional neural network, also called a dense network. A neural network is classically composed of several layers Ce, Cl, Cl+1, and Cs of interconnected neurons. The network has at least one input layer Ce and one output layer Cs, and several intermediate layers C1, C1+1, also called hidden layers. The neurons Ni, e of the input layer Ce receive input data. The input data can be of different types depending on the intended application. For example, the input data could be pixels from an image. The general function of a neural network is to learn to solve a given problem, for example, a classification, regression, recognition, or identification problem.A neural network is, for example, used in the field of image classification or image recognition, or more generally the recognition of features that can be visual, audio, or textual.

[0035] Each neuron in a layer is connected, via its input and / or output, to all the neurons in the preceding or following layer. More generally, a neuron may be connected to only some of the neurons in another layer, particularly in the case of a convolutional neural network. The connections between two neurons Nie, Ny of two successive layers are made through artificial synapses Si, S2, S3, which can be implemented, in particular, by digital memories or memory devices. The synapse coefficients are optimized using a neural network learning mechanism. The learning mechanism aims to train the neural network to solve a defined problem.This mechanism comprises two distinct phases: a first phase of data propagation from the input layer to the output layer, and a second phase of error backpropagation from the output layer to the input layer, with synapse weights updated for each layer. The errors calculated by the output neurons at the end of the data propagation phase are related to the problem to be solved. Generally, this involves determining the error between the value of an output neuron and an expected or target value, depending on the problem to be solved.

[0036] During the first data propagation phase, training data, for example reference images or image sequences, are provided as input to the neurons of the input layer and propagated throughout the network. Each neuron implements, during this first phase, a function for integrating the received data, which, in the case of a convolutional network, consists of calculating a sum of the The received data is weighted by the synapse coefficients. In other words, each neuron performs a convolution operation on a convolution filter size corresponding to the size of the sub-matrix of neurons in the previous layer to which it is connected. Each neuron then propagates the result of the convolution to the neurons in the next layer. Depending on the chosen neuron models, the integration function it performs can vary.

[0037] The NijS neurons of the output layer Cs perform additional processing in that they calculate an error between the output value of the NijS neuron and an expected or target value that corresponds to the desired final state of the output layer neuron with respect to the training input data and the problem to be solved by the network. For example, if the network is to solve a classification problem, the expected final state of a neuron corresponds to the class it is supposed to identify in the input data.

[0038] More generally, for each specific problem to be solved (classification, regression, prediction), one or more cost function(s) or objective function(s) are associated with optimization (by minimization or maximization). One objective of the error backpropagation phase is to find the network parameters that optimize (for example, minimize) the objective function.

[0039] The objective function depends on the data propagated between each layer of the network from the input layer but also on other parameters, for example the identifiers of the classes to which the data belong in the case of a classification problem.

[0040] During the second backpropagation phase, the neurons in the output layer Cs transmit the calculated errors to the neurons in the preceding layer Ci+i, which calculate a local error from the backpropagated error of the preceding layer and, in turn, transmit this local error to the preceding layer Cp. In parallel, each neuron calculates, from the local error, an update value for the weights of the synapses to which it is connected and updates the synapses. The process continues for each layer of neurons up to the penultimate layer, which is responsible for updating the weights of the synapses that connect it to the input layer Ce.

[0041] Figure 1 represents an example of a neural network given by way of illustration and not limitation. In general, each intermediate layer of a network can be fully or partially connected to another layer.

[0042] The network's input data can be organized in the form of matrices. The network can be configured to generate as output a score, classification information, or any other type of output suitable for the problem to be solved.

[0043] For example, if the input data are extracted images or features From images or sequences of images, a neural network can be configured to recognize objects extracted from the images and classify them according to different predefined classes or categories. The problem solved by the network is then a classification problem.

[0044] A classification problem can also be applied to textual data, documents, Internet pages, audio data.

[0045] The problem to be solved by the neural network can be of a very diverse nature. It may be a problem of classifying elements into different categories with the aim of learning to recognize these elements.

[0046] The problem may also consist of the approximation of an unknown function or an accelerated modeling of a known but complex function to calculate or even a regression or prediction problem.

[0047] Figure 1 shows, for illustrative purposes only, a neural network comprising only two intermediate layers and a small number of neurons per layer. However, in a real-world application, the number of intermediate layers is often greater and the number of neurons per layer reaches several hundred or even several thousand.

[0048] Consequently, the large number of parameters of such a network implies a large storage capacity to store the synaptic coefficients and a high computing capacity to perform a large number of operations.

[0049] The invention aims to provide a solution for reducing the dimensions of a dense neural network to facilitate its implementation on a computing device with limited resources.

[0050] Figure [fig.2] illustrates, on a flowchart, the general principle of a method for compressing a teaching neural network into a student neural network according to an embodiment of the invention.

[0051] The method according to the invention aims to transform a high-dimensional neural network (TN) into a low-dimensional neural network (SN). The neural network used as input to the method is called the teacher network (TN). The neural network obtained as output of the method is called the student network (SN).

[0052] The first step 201 of the method consists of training the teaching network TN on a set of training data DE or learning data to solve a given problem associated with an objective cost function to be optimized L(0TN), with 0TN denoting the parameters of the network TN to be optimized.

[0053] As a reminder, several examples of cost functions that can be used to parameterize a neural network when learning different problems are described below.

[0054] We first describe an example which concerns a classification problem of input data in two separate classes Ci and C2.

[0055] The training data are denoted x; and are labeled via the labels y;. y;=0 if Xi belongs to the first class Cp y;=l if x; belongs to the second class C2.

[0056] A neural network is constructed to determine predictions as to whether new data belong to one of two classes. These predictions are formulated via the following relationship:

[0057] « =

[0058] [3 is a vector representing the network parameters and o is the sigmoid function. [00591

[0060] An example of a cost function to be optimized to determine the optimal network parameters is the following function: [00611 L cl^fw = - n E " = 1?,10g ( î'. ) + ( 1 - ) log ( 1 - V.)

[0062] This cost function is optimized during the error backpropagation phase for example by means of a gradient descent algorithm which consists of determining the optimal parameters by successive iterations.

[0063] + ] “ Pt ~ ^classif ( ' °ù denotes the gradient operator and V a setting.

[0064] In the case of a classification problem with more than two classes, an example of a cost function to be optimized is given by the following relation: 100651 [MY)\

[0067] In general, a neural network can be modeled by a function f different from the function o via the following relation:

[0068] y = f (X;,0), with 0 representing the synaptic coefficients or network weights.

[0069] A person skilled in the art may refer to the reference work [4] on networks of artificial neurons to perform step 201 of the method according to the invention for any type of problem to be solved and neural network architecture.

[0070] In the case of a regression problem which consists of predicting, from a given value Xi, a corresponding continuous quantity y, an example of a cost function is the mean squared error: mlm = )1E" , h v.-v. il 2 regress v 7 H j ? il

[0072] In general, the TN teacher network is composed of L layers of neurons and is modeled using the following relationships:

[0073] h^ = x

[0075] x corresponds to the input data of the network, in other words, the input data of the first layer (1=0) of the network. The x data are vectors of dimension p0, which is also the number of neurons in the first layer.

[0076] / j is the activation function implemented by the neurons of layer index 1 of the network. corresponds to the characteristics produced at the output of the neurons of the index layer 1. The dimension of the vector which is also the number of neurons of the index layer 1 is denoted pb jy1 is the weight matrix of dimension pi by piii (1 ) is a bias associated with the index layer 1. "TN

[0077] The pi dimensions exhibit high values, typically several hundred or thousands of neurons. One objective of the invention is to reduce these dimensions.

[0078] The 201 training of the TN teacher network is typically carried out on a training data set represented by a matrix X=[xi,.. .,xn] of dimension p0 by n. For example, it consists of n images or sequences of images or audio or textual sequences or any other data or measurements depending on the intended application.

[0079] The second step 202 of the method according to the invention consists of reducing the dimensions pi to dimensions ki to generate a student neural network SN comprising as many layers as the teacher neural network TN, but whose intermediate layers (or hidden layers) have a number of neurons ki less than or equal to pi. In other words, the dimensionality reduction is applied to at least one hidden layer of the teacher network TN among all the layers except the first layer (1=0) and the last layer (1=L-1). That is to say, the dimensionality reduction can be applied to all the hidden layers or only a subset of them.

[0080] In a first variant, the dimensions ki are chosen arbitrarily or according to the computational resource constraints of the device on which the student network is implemented.

[0081] In a second variant, the dimensions ki are chosen in an optimized way from a principal component analysis applied to the features extracted from the layers of the teaching neural network during its learning 201.

[0082] This second variant is illustrated in [fig.3].

[0083] After training the teacher network TN, the output characteristics of each layer are extracted 301 and are thus noted / / P ] matræe characteristics obtained for each layer 1 of the TN network during its training. y(0) denotes the vector of characteristics obtained at the output of the layer

[0084]

[0085]

[0086]

[0087]

[0088]

[0089]

[0090]

[0091]

[0092]

[0093]

[0094]

[0095]

[0096]

[0097]

[0098]

[0099] index 1 of the TN teacher network from the x learning data;. We then apply a dimensionality reduction method to the Hi matrix from a principal component analysis. From the characteristics Hi extracted after training the teacher network TN, we calculate the covariance matrix 302: I Ç n Al)Al)T with Ah Al) j Y 11 , O Ci = hL h' ~ hi We then calculate 303 the pi eigenvalues ​​of the covariance matrix Ci. These eigenvalues ​​are sorted in descending order: y ... s In step 304, we then determine the dimension ki of each layer of the student network by finding the minimum value of ki for which the following relationship is respected: E “ ,2'' (1) E " ,4° h is a predetermined threshold that defines the percentage of information from the teacher network that we want to keep in the student network. The criterion defined in step 304 consists of finding the minimum value of ki for which the ratio between the sum of the dominant ki eigenvalues ​​and the total sum of the pi eigenvalues ​​is greater than or equal to the threshold £. Typical threshold values ​​are, for example, 0.8, 0.9 or 0.99. In one embodiment variant, an additional step 305 of initializing a projection matrix containing the ki dominant eigenvectors of the matrix Ci is performed. The neural network studying SN is then defined as follows: rC0> h - x The input data x of the network are of the same dimension p0 as for the teacher network TN. / z is the activation function implemented by the neurons of the index 1 layer of the network. corresponds to the characteristics produced at the output of the neurons of the index 1 layer. The dimension of the vector ^(9, which is also the number of neurons of the index 1 layer, is equal to kb (C is the weight matrix of dimension ki by ki ir C). This is a bias associated with the index 1 layer. b In step 203 of the method according to the invention, the student network SN is then

[0100]

[0101]

[0102]

[0103]

[0104]

[0105]

[0106]

[0107]

[0108] trained from the same training data DE as the teacher network TN. If the dimensionality reduction step 202 was only applied to some of the layers of the teacher network TN, the layers whose dimensionality was not reduced are identically reproduced in the student network SN. In another embodiment variant, a subset of the DE training data is used to perform SN student network training. In yet another embodiment, the DE training data is replaced by a new dataset whose content is close to the DE training data, for example from a semantic point of view. If we denote by Lh the objective cost function associated with the problem to be solved by the teacher network TN, the student network SN is optimized to solve a joint problem consisting of the problem to be solved by the network TN and a second problem of reconstructing the features extracted from the teacher network TN projected into subspaces of dimension ki defined by projection functions %? / (), parameterized by a set of parameters 0L Thus, the objective function to be optimized during the learning of the SN student network can be formulated, for example, as follows: WU>, d[, À 2 / j = e*pbL + \ ' pb' l J \ l / problem Lmse denotes the mean squared error ^mse r represents the vector of features associated with the input data x; and extracted from layer index 1 of the SN student network. (0 represents the vector of features associated with the input data x; and extracted to layer index 1 of the TN teacher network.

[0109] represent the parameters of the student network SN to be optimized (otherwise said the synaptic weights associated with each layer of the network and a bias ^(0).

[0110] The parameters h and are scalars optimized during the training process.

[0111] The 0i parameters of the projection function are learned jointly with the parameters of the student network SN during its learning. In this way, we improve the projection of the features extracted from the teacher network onto the reduced dimension space associated with the student network.

[0112] In other words, the parameters of the projection function ^ / () evolve during the learning of the student network SN until they reach optimized values.

[0113] The overall cost function L(0SN) is optimized for example by means of a gradient descent algorithm which consists of determining the optimal parameters by successive iterations.

[0114] 8SNt+ j ~ @SNt " L ( 0SN( ), where V denotes the gradient operator and a setting.

[0115] 0 denotes the set of parameters to be optimized: - < 0 , w,b

[0116] In particular, (O is a function that depends on the parameters @$n- Thus, it is it is possible to calculate the gradient of the function L^e-

[0117] Several embodiment variants are conceivable for determining the projection function ^0 / () for at least one layer 1 of the SN network.

[0118] In a first variant, the projection function ^0 / () is a projection matrix of dimensions πpar kb. This projection matrix is ​​initialized with random values ​​or with the values ​​of the projection matrix Ui determined in step 305 from the principal component analysis. The initial values ​​of this projection matrix then evolve during the training of the SN student network until they reach optimized values.

[0119] In a second variant, the projection function ^ / () is defined by a neural network having several layers. For example, it could be a network with two layers separated by a nonlinear activation function. According to this variant, the projection function is defined as ( ï ) = VT tp(UT where U and V denote respectively the synaptic weight matrices of the two layers of the network and 0 denotes a nonlinear activation function, for example a ReLU or hyperbolic tangent function.

[0120] This second variant improves the performance of the student network in particular when the relationship between the teacher network and the student network is non-linear.

[0121] More generally, the projection function ^0 / () can be defined by a neural network having more than two layers, each layer being connected to the next via a non-linear activation function.

[0122] Whatever variant is chosen, the parameters of the projection function ^0 / (), in other words the coefficients of the projection matrix or the synaptic coefficients of the layers of the neural network, are learned during the learning of the student network SN and jointly with the parameters of this student network SN.

[0123] In an alternative embodiment, the dimensionality reduction step 102 is applied to all layers of the teacher network TN, but only some of the layers of the student network SN (typically the last hidden layer or layers) are updated by learning the parameters from the projection function ^0 / () is applied in conjunction with the parameters of the student network SN during its training. The other layers of the student network SN are updated by replacing the projection function ^ / () with the projection matrix Ui, which contains the ki dominant eigenvectors of the covariance matrix Ci determined in step 305. In yet another variant, the other layers of the student network SN are updated using classical training based solely on the problem to be solved by the teacher network, without taking any projection function into account.

[0124] T / rU) n \ . The expression of the function LW, b, 6h À,, à,] = e L {hi) + 4, F problem The cost of Lmse is replaced by [01251 urth^y) = aly, ii 4"- u^1') ii2

[0126] The projection matrix Ui is determined from the features extracted after training the teacher network TN and does not change during training the student network SN. This variant corresponds to the method described in the Applicant's patent application FR 2005884.

[0127] Once trained, the student network SN can be implemented on a resource-limited computing device to be executed in order to solve the problem initially addressed by the teacher network TN.

[0128] One advantage of optimizing the projection function parameters during the training of the student network is that it allows for better adaptation of the projection to the problem to be solved by the teacher and student networks. In this way, the performance of the student network more closely approaches that of the teacher network.

[0129] Figures 4a and 4b illustrate examples of results obtained with the method according to the invention.

[0130] The diagrams in Figures 4a and 4b represent the classification performance obtained for data belonging to a public image database "Fashion MNIST". The x-axis corresponds to a progress index in the database and the y-axis represents a percentage of classification correctly performed by the neural network being studied.

[0131] Fig. 4a corresponds to a student neural network whose dimensions are reduced so as to retain e = 80% of the information during the dimension reduction step 304 (see equation (1) defined previously).

[0132] The three curves correspond to the same reduced-dimension student network by means of step 304 of [fig.3].

[0133] Curve 401 corresponds to a student neural network trained using a classical training method, i.e., using as a cost function that of the teaching neural network associated with the single problem L b.

[0134] Curve 402 corresponds to a student neural network trained using the method described in patent application FR 2005884, i.e. by exploiting features extracted from the teacher network after its training but without optimizing the projection matrix during training.

[0135] Finally, curve 403 corresponds to a student neural network trained using the method according to the invention.

[0136] It can be seen that the invention makes it possible to obtain the best classification results (curve 403) compared to the two other methods (curves 401,402).

[0137] Fig. 4b represents the same type of results obtained this time for a value of e = 99%. Curves 410, 420, 430 correspond respectively to the training methods used for curves 401, 402, 403 of Fig. 4a.

[0138] It is noted that when the network dimension reduction rate is less important, the method of application FR 2005884 shows performance close (curve 420) to that of a classical method (curve 410) while the present invention (curve 430) makes it possible to further improve classification performance.

[0139] The invention can be implemented as a computer program comprising instructions for its execution. The computer program can be stored on a storage medium readable by a processor.

[0140] The reference to a computer program that, when executed, performs any of the functions described above, is not limited to an application program running on a single host computer. Rather, the terms computer program and software are used here in a general sense to refer to any type of computer code (for example, application software, firmware, microcode, or any other form of computer instruction) that can be used to program one or more processors to implement aspects of the techniques described herein. The computing means or resources may, in particular, be distributed ("cloud computing"), possibly using peer-to-peer technologies.The software code can be executed on any suitable processor (e.g., a microprocessor) or processor core, or a set of processors, whether located in a single computing device or distributed across multiple computing devices (e.g., as potentially accessible within the device's environment). The executable code for each program, enabling the programmable device to implement the processes according to the invention, can be stored, for example, on the hard drive or in read-only memory. Generally, the program(s) can be loaded into one of the device's storage means before execution. The central processing unit can command and direct the execution of the instructions or portions of software code of the program(s) according to the invention. the invention, instructions which are stored in the hard drive or in read-only memory or in the other aforementioned storage elements.

[0141] The neural network student SN is implemented on a computing device based, for example, on an embedded processor. The processor can be a generic processor, a specific processor, an application-specific integrated circuit (ASIC), or a field-programmable gate array (FPGA). The computing device can use one or more dedicated electronic circuits or a general-purpose circuit. The technique of the invention can be implemented on a reprogrammable computing machine (a processor or a microcontroller, for example) executing a program comprising a sequence of instructions, or on a dedicated computing machine (for example, an array of logic gates such as an FPGA or an ASIC, or any other hardware module).

[0142] The invention is applicable in many fields in which there is a need to solve a complex problem, in particular a classification or regression problem.

[0143] For example, the invention applies to the analysis of image or video data, or more generally multimedia data, to solve a problem of classification, segmentation, or detection of objects in multimedia data. In this case, the input data to the network is multimedia data.

[0144] The invention can be implemented in embedded devices comprising several silicon layers respectively dedicated to the acquisition of input data (e.g., image or video) and to the calculations related to the neural network. The neural network being studied, obtained through the invention, can be more easily embedded in such a device because its size is reduced.

[0145] The invention can also be applied to the analysis of textual data. Références

[0146] [1] Song Han et al, « Deep compression : compressing deep neural networks with pruning, trained quantization and Huffman coding », 2015

[0147] [2] Seyed-Iman Mirzadeh et al, “hnproved knowledge distillation via teacher assistant: bridging the gap between student and teacher”, 2019

[0148] [3] Junho Yim et al, “A gift from knowledge distillation: fast optimization, network minimization and transfer leaming”, IEEE conférence on computer vision and pattern récognition, 2017

[0149] [4] Paul Rojas, “Neural networks- a systematic introduction”, 1996

[0150] [5] Alaa Tharwat et al, “Linear discriminant analysis: a detailed tutorial”, AI commun, 2017

Claims

Claims

1. A computer-implemented method for reducing the size of a first artificial neural network called a teacher network (TN) to obtain a second artificial neural network of reduced size called a student network (SN), the method comprising the steps of: - Training (201) the teacher network to solve a first given problem for a first set of training data organized in the form of several data vectors, - After training the teacher network, for each data vector and for at least one intermediate layer of the teacher network, extracting (301) the output characteristics of the layer of the teacher network in the form of a vector having a first dimension pb - For at least one intermediate layer of the student network,initialize a projection function in a subspace of dimension ki strictly less than the first dimension pb - Train (203) the student network on a second set of training data to jointly solve the first problem and a second problem of reconstructing the characteristics extracted from the teacher network projected into the subspaces of dimensions ki defined by the projection functions, - The parameters of the projection functions being learned during the training of the student network jointly with the parameters of the student network.,

2. The method of claim 1 wherein the second training data set consists of all or part of the first training data set or consists of data semantically similar to the data of the first training data set.

3. Method according to claim 1 in which the projection functions are projection matrices of dimensions (pbki).

4. Method according to claim 1 in which the projection functions are neural networks with at least two layers and at least minus a nonlinear activation function between each pair of successive layers.

5. Method according to any one of the preceding claims further comprising, after training the teaching network, for each data vector and for at least one intermediate layer of the teaching network, a principal component analysis applied to the characteristic vectors to determine the dimension ki of the projection subspace.

6. Method according to claim 5 in which the principal component analysis comprises the sub-steps of: - Calculating (302) the covariance matrix Ci of the feature vectors of dimension pb - Determining (303) the eigenvalues of the covariance matrix Ci, - Determining (304) the dimension ki of the projection subspace as being the smallest possible integer value for which the ratio between the sum of the ki dominant eigenvalues and the total sum of the eigenvalues is greater than or equal to a predetermined threshold.

7. A method according to claim 6 in combination with claim 2 wherein the projection matrices are initialized to matrices containing the ki dominant eigenvectors of the covariance matrix C'

8. Cp Method according to any one of the preceding claims in which the first problem is associated with a first predetermined objective function to be minimized and the second problem is associated with a second objective function to be minimized defined as the mean square error between the output characteristics of the intermediate layers of the student network (SN) and the output characteristics of the respective intermediate layers of the teacher network (TN) projected onto the ki-dimensional subspace via the projection function.

9. Method according to claim 8 in which, to jointly solve the first problem and the second problem, the training of the student network (SN) is carried out so as to determine the parameters of the student network and of the projection function which minimize the sum of the first objective function and of the second objective function.

10. A method according to any preceding claim wherein the training data is image, audio, video, multimedia or text data.

11. A computing device configured to implement a student artificial neural network obtained from a teacher artificial neural network by applying the method according to any one of the preceding claims.

12. A computer program comprising instructions for executing the method according to any one of claims 1 to 10, when the program is executed by a processor.

13. A processor-readable recording medium having recorded thereon a program comprising instructions for executing the method according to any one of claims 1 to 10, when the program is executed by a processor.