EP4115337A1 - Method and apparatus for compressing a neural network - Google Patents

Method and apparatus for compressing a neural network

Info

Publication number
EP4115337A1
EP4115337A1 EP21707207.3A EP21707207A EP4115337A1 EP 4115337 A1 EP4115337 A1 EP 4115337A1 EP 21707207 A EP21707207 A EP 21707207A EP 4115337 A1 EP4115337 A1 EP 4115337A1
Authority
EP
European Patent Office
Prior art keywords
neural network
compression
iii
subset
trained neural
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
EP21707207.3A
Other languages
German (de)
French (fr)
Inventor
Fabian HÜGER
Serin VARGHESE
Peter Schlicht
Yuan Ma
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Volkswagen AG
Original Assignee
Volkswagen AG
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Volkswagen AG filed Critical Volkswagen AG
Publication of EP4115337A1 publication Critical patent/EP4115337A1/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/082Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S13/00Systems using the reflection or reradiation of radio waves, e.g. radar systems; Analogous systems using reflection or reradiation of waves whose nature or wavelength is irrelevant or unspecified
    • G01S13/88Radar or analogous systems specially adapted for specific applications
    • G01S13/93Radar or analogous systems specially adapted for specific applications for anti-collision purposes
    • G01S13/931Radar or analogous systems specially adapted for specific applications for anti-collision purposes of land vehicles
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S17/00Systems using the reflection or reradiation of electromagnetic waves other than radio waves, e.g. lidar systems
    • G01S17/88Lidar systems specially adapted for specific applications
    • G01S17/93Lidar systems specially adapted for specific applications for anti-collision purposes
    • G01S17/931Lidar systems specially adapted for specific applications for anti-collision purposes of land vehicles

Definitions

  • the invention relates to a method and a device for compressing a neural network.
  • the invention also relates to a computer program and a data carrier signal.
  • Modern driver assistance systems and driving functions for automated driving are increasingly using machine learning, among other things, to recognize the vehicle environment including other road users (e.g. pedestrians and other vehicles) and to describe their behavior.
  • the evaluation of input data (input) from various sources takes place through deep neural networks, which, among other things, carry out pixel-by-pixel classifications (semantic segmentation) or create enclosing frames (bounding boxes) of recognized objects.
  • CNN convolutional neural networks
  • the convolution networks used here increasingly use a large number of filters and layers, so that the time and computational effort required to process (inference) input data into outputs (output) increases. Since the use of neural networks in the area of automatic driving is subject to severe restrictions with regard to the required computing time due to the dynamic environment and at the same time the hardware (computing capacities) that can be used in vehicles cannot be scaled as desired, the size of the neural network is a limiting factor with regard to the possible uses in such systems.
  • the choice of the elements to be removed is important here. Different elements can influence the output of the network to different degrees. It is therefore important to use selected strategies to select those elements whose removal causes the least effects on the output (quality) and at the same time to check the largest possible number of elements in order to significantly reduce the size of the neural network and thus minimize inference. and to achieve training times.
  • the method comprises the extraction of convolution layers from a trained CNN, each convolution layer containing a kernel matrix with at least one filter formed in a corresponding output channel of the kernel matrix, a feature map set with a feature map that corresponds to each filter.
  • An absolute kernel weight is determined for each kernel and added up over each filter in order to determine a strength of each filter.
  • the strength of each filter is compared to a threshold and a filter is removed if the determined strength is below the threshold.
  • a feature map corresponding to each of the removed filters is removed to prune the CNN.
  • the CNN is retrained to produce a checked CNN with fewer convolutional layers.
  • a method, a computer-readable medium and a system for checking a neural network are known from US 2018/0114114 A1.
  • the method comprises the steps of receiving first order gradients of a cost function relative to slice parameters for a trained neural network and calculating a pruning criterion for each slice parameter based on the first order gradient corresponding to the slice parameter, the pruning criterion indicating an importance of each neuron, which is contained in the trained neural network and is assigned to the slice parameter.
  • the method comprises the additional steps of identifying at least one neuron with the least importance and removing the at least one neuron from the trained neural network in order to generate a tested neural network.
  • Quantization teacher-student learning or AutoML for Model Compression (AMC) are known as further compression methods.
  • AMC AutoML for Model Compression
  • the number of bits is reduced which are necessary to represent parameters of a neural network. So no parameters or entire filters are removed, but representations of the parameters that can be processed more quickly are selected, thus achieving more efficient processing on a given hardware.
  • teacher-student learning two models are trained instead of a single neural network. Here acts the first as a "teacher” and the second as a "student”.
  • the student model is also trained using the input data from the teacher model.
  • the teacher model passes on information to the student model in every step so that the student model can adapt to the teacher model. As a rule, a smaller neural network architecture is used for the resulting student model.
  • AMC AutoML for Model Compression
  • the invention is based on the object of improving a method and a device for compressing a neural network.
  • a method for compressing a neural network is provided, a trained neural network being obtained, with at least one structural information item of the trained neural network being extracted or obtained, the trained neural network subdividing into subsets for compression depending on the at least one structural information item is, wherein a compression method is selected and used for each subset depending on at least one property of the respective subset, and wherein the compressed neural network is provided.
  • a device for compressing a neural network comprising a computing device, the computing device being set up to receive a trained neural network, to extract or receive at least one structural information item of the trained neural network, the trained neural network for compression in To subdivide the at least one structural information into subsets as a function of the at least one structural information item, and to select and use a compression method for each subset as a function of at least one property of the respective subset, and to provide the compressed neural network.
  • the method and the device make it possible to compress a neural network in an improved manner, since different compression methods can be used for individual subsets of the neural network.
  • a compression method is not used for the entire neural network, but a compression method that is most suitable for this can be used for each subset of the neural network, that is, for different sub-units or sub-blocks etc.
  • a trained neural network the subsets of which are locally optimally compressed in each case, is overall improved compared to a compression of the entire neural network using only a single compression method.
  • This is achieved by dividing a fully trained neural network into subsets for compression depending on at least one piece of structural information.
  • the at least one piece of structural information is either extracted from a structure of the trained neural network or the at least one piece of structural information is provided and received.
  • the at least one structure function includes, in particular, a description of the neural network with regard to a structure, that is to say the individual components, such as functional blocks, layers, etc., and their respective interconnection.
  • the at least one structural information item therefore describes, in particular, an internal structural structure of the neural network.
  • a compression method to be used in each case is selected and used as a function of at least one property of the respective subset.
  • the compression then takes place in particular iteratively for each of the specific subsets.
  • a subset of the neural network is compressed by means of the corresponding selected compression method, while the other subsets of the neural network remain unchanged or are not compressed during this time. If this subset of the neural network is compressed, the next subset is compressed, while the other subsets remain unchanged. When all subsets have been compressed with the selected compression method, compression is finished. The neural network compressed in this way is then made available.
  • the provision includes in particular outputting the compressed neural network, for example in the form of a digital data record describing the structure and the weightings or parameters of the compressed neural network.
  • Providing can also include transmitting the compressed neural network to a control device, for example a vehicle, and / or storing the compressed neural network in a memory of the control device so that the compressed neural network can be used there.
  • a control device for example a vehicle
  • a control device for example a vehicle
  • the targeted selection of compression methods for each of the subsets can in particular ensure that any redundancy present in the neural network is minimized.
  • the possibility of individually selecting each of the compression methods for the subsets means that different priorities or objectives can be set for each of the subsets when compressing (e.g. reduced runtime, improved stability, etc.).
  • a neural network is in particular an artificial neural network, in particular a convolutional neural network.
  • the neural network is trained in particular for a specific function, for example the perception of pedestrians in captured camera images.
  • the neural network includes in particular at least one piece of structural information that describes a structure of the neural network, and parameters that describe, for example, weightings of activation functions of individual neurons or of filters, etc.
  • the parameters were determined in particular with the aid of a training data set.
  • Pruning is intended to mean in particular that the structure of the particular subset of the neural network under consideration is changed, in particular trimmed or reduced in size. This is done by removing elements and / or parts (eg parameters or input channels etc.) of the elements from the subset of the neural network. Due to the changed, in particular trimmed, structure, the tested subset of the neural network can be applied to input data with a lower computing power and with a reduced memory requirement. The structure of the tested subset of the neural network is then compressed. The elements of the subset of the neural network to be checked can be selected in various ways.
  • those elements of the subset of the neural network are selected for testing which have the least influence on an output result of the subset of the neural network and / or the neural network. Provision can furthermore also be made for elements to be selected whose outputs are always activations below a predetermined threshold value.
  • the selected elements are collected and compiled, for example, in the form of a list or table or database.
  • a list or table or database for example, an unambiguous identification of a respectively selected element is noted as well as possibly further properties or values, such as for example a maximum, minimum and / or average activation of the element under consideration.
  • the list or the table or database includes a selection criterion used in each case or a value of the respective element associated with the selection criterion used in each case.
  • the individual elements in the list or table or database can be sorted according to a ranking. The pruning is then carried out depending on the order of precedence. For example, a predetermined number of top ranks is checked.
  • a ranking is generated depending on similarities and contexts.
  • the ranking favors filters for which none similar filters exist versus filters for which similar filters exist.
  • the similarity can be determined, for example, by means of Jensen-Shannon divergence, linear dependency, cosine similarity or methods of anomaly detection.
  • the compressed neural network is retrained after compression.
  • training data are again fed to the compressed neural network and the compressed neural network is trained in a manner known per se.
  • Parts of the device in particular the computing device, can be designed individually or collectively as a combination of hardware and software, for example as program code that is executed on a microcontroller or microprocessor.
  • the method can be carried out as a computer-implemented method.
  • the method can be carried out by means of a data processing device.
  • the data processing device comprises in particular at least one computing device and at least one storage device.
  • a computer program is also created, comprising instructions which, when the computer program is executed by a computer, cause the computer to carry out the method steps of the disclosed method in accordance with any of the described embodiments.
  • a data carrier signal is also created that transmits the aforementioned computer program.
  • the subdivision and / or selection of the compression method takes place at least partially as a function of a functionality provided by the respective subset of the trained neural network.
  • a neural network has several functional components, such as feature extractors, fusion blocks, depth estimators, instance segmentations, optical streams, region proposals, classifiers, etc.
  • the most suitable compression method for each of these building blocks can be used.
  • the Fisher pruning technique is particularly good at compressing
  • Subsets that provide functionality of feature extractors are suitable.
  • the Fisher pruning compression method is selected and used in the trained neural network for all such subsets that provide feature extractors.
  • other subsets that provide other functionalities can be compressed using other compression methods.
  • the subdivision and / or selection of the compression method takes place at least partially as a function of a position of the respective subset within the trained neural network.
  • layers of the neural network can be combined into subsets as a function of a position within the neural network and then compressed using a compression method selected in each case.
  • a distinction can be made between starting layers, middle layers and starting layers.
  • a compression method that is best suited for compressing a subset of the neural network under consideration can be determined empirically in particular by comparing different compression methods with one another with regard to a desired result (e.g. a required computing power and / or a memory requirement and / or a functional quality, etc.) will. From the comparison results, it is then possible to derive dependencies and rules about which compression methods are particularly suitable for certain types and / or positions of subsets and which are not.
  • a desired result e.g. a required computing power and / or a memory requirement and / or a functional quality, etc.
  • a heuristic method is used when selecting a respective compression method for the specific subsets.
  • the heuristics can be determined on the basis of the empirical test series described above, for example.
  • a heuristic describes an expected effect of a compression method with regard to a running time and / or an energy requirement and / or a memory requirement and / or with regard to a position and / or a size of the subset to be compressed. Provision can be made for the heuristics to be adapted and / or improved step-by-step by repeated application of the method and the knowledge gained in this way. It is also possible to have the heuristics at least partially created and / or checked and / or adapted by human experts.
  • the heuristics can be used with Deliver a respective result with the help of weighted influencing parameters. This is particularly advantageous if no clear statements about the most suitable compression method are available or possible.
  • the compression methods to be compared with one another are then compared with one another using a respective sum value, for example on the basis of a weighting function, and selected.
  • the respective compression method is carried out as a function of at least one optimization criterion.
  • Optimization criteria are, for example, the following: a functional quality or accuracy of the (compressed) neural network, a required computing power (of the subset considered) and / or a required storage space (the subset considered).
  • the compressions of the subsets of the neural network that are carried out individually are each carried out according to the at least one optimization criterion.
  • an optimization according to the at least one optimization criterion of the entire neural network is considered. If an optimization criterion is, for example, a required running time, the subset is compressed using the associated compression method and a running time of the neural network is determined for each iteration step. The compression method is then carried out or parameterized in such a way that this runtime is optimized, in particular minimized.
  • the at least one optimization criterion is selected and / or specified as a function of at least one property of a control device on which the compressed neural network is to be executed after compression.
  • the properties can include, for example, an available computing power and / or an available memory space. It can be provided here that these properties are queried from the control unit before the compression.
  • the selection and / or the execution of the respective compression method takes place as a function of at least one piece of geographic information and / or at least one piece of context information.
  • the compression method can be adapted to geographical conditions, such as certain features in the environment that are processed by means of the neural network, and / or to a situational context, such as an environmental context (e.g. city, motorway, country road, parking garage, etc.), be adjusted.
  • the compression takes place while taking into account acquired sensor data. This allows properties of the sensor data to be taken into account. In this way, in particular, compression methods can be selected which are more suitable in terms of content and / or structure for a certain type of sensor data.
  • the compression of the neural network is only limited to specific vehicles in the vehicle fleet.
  • a geographically, for example regionally, restricted and / or adapted compression of the neural network can take place here.
  • the compression is carried out, for example, in the vehicle as a function of a geographical position and / or at least one piece of context information. In this way, vehicle-specific compressed neural networks can be provided.
  • the neural network provides a function for the automated driving of a vehicle and / or for a driver assistance of the vehicle and / or for a surrounding area detection and / or surrounding area perception.
  • a vehicle is in particular a motor vehicle.
  • a vehicle can also be another land, air, water, rail or space vehicle.
  • FIG. 1 shows a schematic representation of an embodiment of the device for compressing a neural network
  • the device 1 shows a schematic representation of an embodiment of the device 1 for compressing a neural network 10.
  • the device 1 comprises a computing device 2 and a storage device 3.
  • the computing device 2 can access the storage device 3 and perform arithmetic operations on data stored therein.
  • the computing device 2 carries out the method described in this disclosure.
  • a trained neural network 10 is fed to the computing device 2, the computing device 2 receiving the trained neural network 10.
  • the computing device 2 receives the trained neural network 10 by means of an interface set up for this purpose (not shown).
  • the trained neural network 10 provides a function for automated driving of a vehicle and / or for driver assistance of the vehicle and / or for environment detection and / or environment perception.
  • the computing device 2 extracts or receives at least one piece of structural information from the trained neural network 10.
  • This at least one piece of structural information includes, in particular, information about the structure of the trained neural network 10.
  • the trained neural network 10 is divided into subsets as a function of the at least one structural information item.
  • the computing device 2 selects a compression method depending on at least one property of the respective subset.
  • a property can be a functionality or a position of the subset within the neural network 10, for example.
  • the respective subset of the neural network 10 is compressed by means of the compression method selected in each case.
  • the compression is carried out one after the other for all subsets by means of the respectively selected compression method, the other subsets, that is to say both already compressed and not yet compressed, each remaining unchanged when compressing a subset.
  • the entire neural network is particularly considered in each case.
  • the compressed neural network 11 is provided and, in particular, output in the form of a digital data packet. It can be provided that the compressed neural network 11, in particular as a digital data packet, is transmitted to a control device 51, for example a vehicle, and is loaded into a memory there. The control device 51 can then execute the compressed neural network 11 and apply it to acquired sensor data, for example. Due to the compression, a required running time, a required computing power and / or a memory requirement can be reduced.
  • FIG. 2 shows a schematic flow diagram to illustrate embodiments of the method for compressing a neural network 10. It is provided that the method is carried out in a back-end server 20.
  • the backend server 20 is designed, for example, like the device 1 shown in FIG. 1.
  • a trained neural network 10 and parameters 12 are fed to the backend server 20, the parameters 12 controlling the compression and including at least one optimization criterion 13, for example.
  • the trained neural network 10 provides a function for the automated driving of a vehicle and / or for driver assistance of the vehicle and / or for environment detection and / or environment perception.
  • the compression is controlled by means of a control function 21 provided by the backend server 20.
  • the control function 21 receives the parameters 12 for this purpose.
  • the control function 21 organizes the compression of the trained neural network 10 and has an insight into all intermediate results for this purpose. In particular, the control function 21 organizes the iterative compression.
  • the trained neural network 10 is subdivided into several subsets I, II, III, IV, V by means of a splitter function 22. This takes place as a function of at least one piece of structural information 14, which is extracted from the trained neural network 10 or obtained in some other way, for example received separately from the trained neural network 10.
  • a functionality can be, for example, the following: feature extractors, fusion blocks, depth estimators, instance segmentation, optical streams, Proposals for regions, classifiers, etc.
  • associated subsets which provide these functionalities, are then formed from elements of the neural network 10.
  • the subdivision takes place at least partially as a function of a position of the respective subset I, II, III, IV, V within the trained neural network 10.
  • the position defines, for example, at which point in a processing chain within the trained neural network 10 the respectively considered subset I, II, III, IV, V is located.
  • a distinction can be made, for example, at the beginning, middle and end shifts.
  • a selection function 23 selects a compression method for each of the subsets I, II, III, IV, V as a function of at least one property of the respective subsets I, II, III, IV, V from a catalog 24.
  • a heuristic method is used when selecting a respective compression method for the specific subsets I, II, III, IV, V.
  • the heuristics used here are obtained empirically, for example, that is, by means of targeted test series in which different compression methods are used for different subsets, the effect of which is then evaluated according to specific target criteria.
  • the catalog 24 of compression methods includes, in particular, pruning methods, but can also include other types of compression methods.
  • pruning methods are: Fisher pruning, magnitude pruning and similarity pruning.
  • other compression methods are: quantization, teacher-student learning and AutoML for Model Compression (AMC).
  • the subsets I, II, III, IV, V are each compressed individually by means of central compression modules 25. This is done in particular by always compressing one of the subsets I, II, III, IV, V, while the other subsets I, II, III, IV, V remain unchanged. In order to assess the respective compression result, the entire neural network 10 is considered. If a subset I, II, III, IV, V is compressed, the remaining subsets I, II, III, IV, V are each compressed individually. In the example shown, the following sequence could be used for compression: first subset I, then subset II, then subset III, then subset IV and finally subset V. It can be provided that the compression, in particular the pruning, takes place while taking training data 30 into account. This makes it possible to take into account properties of the training data 30 or an associated data domain.
  • the compressed neural network 11 can be retrained by means of a fine-tuning function 26.
  • the training data 30 are used for this purpose.
  • the compressed neural network 11 is then made available and, in particular, output in the form of a digital data packet. It can then be loaded into a memory of a control device, for example, so that functionality of the compressed neural network 11 can be provided by the control device.
  • the trained neural network 10 can be compressed outside of the backend server 20, in particular in a vehicle 50 of a vehicle fleet, after the subdivision and selection of the respective compression method.
  • the compression methods selected in each case are transmitted to distributed compression modules 27, for example via an air interface (not shown).
  • the compression is then carried out by means of the distributed compression modules 27.
  • sensor data 31 from a current sensor data domain for example from a current environment or context (e.g. a vehicle)
  • a ranking created when checking for activations of elements of the subset I, II, III, IV, V of the trained neural network 10 can be created on the basis of the sensor data 31 which are fed to the neural network 10 as input data.
  • the compression can then take place specifically for an associated sensor data domain.
  • the neural network 11 compressed in this way by means of the distributed compression modules 27 is then retrained and made available by means of the fine-tuning function 26.
  • the respective compression method is carried out as a function of at least one optimization criterion 13.
  • the at least one optimization criterion 13 can include, for example, one or more of the following: a functional quality or accuracy of the (compressed) neural network 11, a required computing power (the considered subset I, II, III, IV, V) and / or a required one Storage space (of the considered subset I, II, III, IV, V).
  • the trained neural network 10 can hereby be optimized in a targeted manner taking into account given boundary conditions.
  • the selection and / or the execution of the respective compression method takes place as a function of at least one piece of geographic information 15 and / or at least one piece of context information 16.
  • the at least one optimization criterion 13 is defined as a function of properties of a control device on which the compressed neural network 11 is then to be executed.
  • properties can be, for example, a provided computing power or an available memory space.

Abstract

The invention relates to a method for compressing a neural network (10), wherein a trained neural network (10) is obtained, wherein at least one piece of structure information from the trained neural network (10) is extracted or obtained, wherein the trained neural network (10) is divided into subsets (I, II, III, IV, V) on the basis of the at least one piece of structure information for the purpose of compression, wherein one compression method is selected and used for each subset (I, II, III, IV, V) on the basis of at least one property of the respective subset (I, II, III, IV, V), and wherein the compressed neural network (11) is provided. The invention also relates to an apparatus (1) for compressing a neural network (10), to a computer program and to a data carrier signal.

Description

Beschreibung description
Verfahren und Vorrichtung zum Komprimieren eines Neuronalen Netzes Method and device for compressing a neural network
Die Erfindung betrifft ein Verfahren und eine Vorrichtung zum Komprimieren eines Neuronalen Netzes. Ferner betrifft die Erfindung ein Computerprogramm und ein Datenträgersignal. The invention relates to a method and a device for compressing a neural network. The invention also relates to a computer program and a data carrier signal.
Moderne Fahrerassistenzsysteme und Fahrfunktionen zum automatisierten Fahren verwenden zunehmend maschinelles Lernen, um unter anderem die Fahrzeugumgebung einschließlich anderer Verkehrsteilnehmer (z.B. Fußgänger und weitere Fahrzeuge) zu erkennen und deren Verhalten zu beschreiben. Hierbei erfolgt die Auswertung von Eingangsdaten (Input) aus verschiedenen Quellen (z.B. Kameras, Radar, Lidar) durch tiefe Neuronale Netze, welche an diesen unter anderem eine pixelweise Klassifikationen vornehmen (semantische Segmentierung) oder Umschließungsrahmen (bounding box) erkannter Objekte erzeugen. Modern driver assistance systems and driving functions for automated driving are increasingly using machine learning, among other things, to recognize the vehicle environment including other road users (e.g. pedestrians and other vehicles) and to describe their behavior. Here, the evaluation of input data (input) from various sources (e.g. cameras, radar, lidar) takes place through deep neural networks, which, among other things, carry out pixel-by-pixel classifications (semantic segmentation) or create enclosing frames (bounding boxes) of recognized objects.
In beiden Fällen werden üblicherweise Faltungsnetze (convolutional neural networks, CNN) eingesetzt, welche im Training die Gewichte sogenannter Filter basierend auf dem Input parametrisieren. Die verwendeten Faltungsnetze nutzen hierbei zunehmend eine Vielzahl von Filtern und Schichten (layer), sodass der benötigte Zeit- bzw. Rechenaufwand zur Verarbeitung (Inferenz) von Eingangsdaten zu Ausgaben (Output) zunimmt. Da der Anwendung von Neuronalen Netzen im Bereich des automatischen Fahrens aufgrund der dynamischen Umgebung harte Einschränkungen bezüglich einer benötigten Rechenzeit obliegen und gleichzeitig die in Fahrzeugen einsetzbare Hardware (Rechenkapazitäten) nicht beliebig skaliert werden kann, ist die Größe des Neuronalen Netzes ein limitierender Faktor im Hinblick auf die Einsatzmöglichkeiten in solchen Systemen. In both cases, convolutional neural networks (CNN) are usually used, which parameterize the weights of so-called filters based on the input during training. The convolution networks used here increasingly use a large number of filters and layers, so that the time and computational effort required to process (inference) input data into outputs (output) increases. Since the use of neural networks in the area of automatic driving is subject to severe restrictions with regard to the required computing time due to the dynamic environment and at the same time the hardware (computing capacities) that can be used in vehicles cannot be scaled as desired, the size of the neural network is a limiting factor with regard to the possible uses in such systems.
Es existieren mehrere Verfahren, um ein Neuronales Netz zu verkleinern bzw. zu komprimieren und hierdurch sowohl einen Speicherbedarf als auch eine benötigte Rechenleistung zu reduzieren. There are several methods of reducing or compressing a neural network and thereby reducing both the memory requirement and the computing power required.
Sogenanntes Prunen (engl. Pruning) versucht die Größe des Neuronalen Netzes durch Entfernen von einzelnen Elementen, das heißt von Neuronen, Parametern bzw. ganzen Filtern etc. zu verringern. Hierbei ist die Wahl der zu entfernenden Elemente von Bedeutung. Unterschiedliche Elemente können die Ausgabe des Netzes unterschiedlich stark beeinflussen. Es gilt also, durch ausgewählte Strategien diejenigen Elemente zu selektieren, deren Entfernung die geringsten Auswirkungen auf die Ausgabe(-qualität) verursacht und dabei zugleich eine möglichst große Anzahl an Elementen zu prunen, um eine signifikante Verkleinerung des Neuronalen Netzes und somit möglichst geringe Inferenz- und Trainingszeiten zu erreichen. So-called pruning attempts to reduce the size of the neural network by removing individual elements, i.e. neurons, parameters or entire filters, etc. The choice of the elements to be removed is important here. Different elements can influence the output of the network to different degrees. It is therefore important to use selected strategies to select those elements whose removal causes the least effects on the output (quality) and at the same time to check the largest possible number of elements in order to significantly reduce the size of the neural network and thus minimize inference. and to achieve training times.
Aus der US 2018/0336468 A1 sind Systeme und Verfahren zum Prunen eines Faltungsnetzes (CNN) bekannt. Das Verfahren umfasst das Extrahieren von Faltungsschichten aus einem trainierten CNN, wobei jede Faltungsschicht eine Kernelmatrix mit mindestens einem in einem entsprechenden Ausgangskanal der Kernelmatrix ausgebildeten Filter enthält, einem Merkmalskartensatz mit einer Merkmalskarte (feature map), die jedem Filter entspricht. Für jeden Kernel wird ein absolutes Kernelgewicht bestimmt und über jeden Filter aufsummiert, um eine Stärke jedes Filters zu bestimmen. Die Stärke jedes Filters wird mit einer Schwelle verglichen und ein Filter wird entfernt, wenn die bestimmte Stärke unterhalb der Schwelle liegt. Eine Merkmalskarte (feature map), die jedem der entfernten Filter entspricht, wird entfernt, um das CNN zu prunen. Das CNN wird erneut trainiert, um ein gepruntes CNN mit weniger Faltungsschichten zu erzeugen. Systems and methods for checking a convolution network (CNN) are known from US 2018/0336468 A1. The method comprises the extraction of convolution layers from a trained CNN, each convolution layer containing a kernel matrix with at least one filter formed in a corresponding output channel of the kernel matrix, a feature map set with a feature map that corresponds to each filter. An absolute kernel weight is determined for each kernel and added up over each filter in order to determine a strength of each filter. The strength of each filter is compared to a threshold and a filter is removed if the determined strength is below the threshold. A feature map corresponding to each of the removed filters is removed to prune the CNN. The CNN is retrained to produce a checked CNN with fewer convolutional layers.
Aus der US 2018/0114114 A1 sind ein Verfahren, ein computerlesbares Medium und ein System zum Prunen eines Neuronalen Netzes bekannt. Das Verfahren umfasst die Schritte des Empfangens von Gradienten erster Ordnung einer Kostenfunktion relativ zu Schichtparametern für ein trainiertes Neuronales Netz und des Berechnens eines Pruningkriteriums für jeden Schichtparameter basierend auf dem Gradienten erster Ordnung, der dem Schichtparameter entspricht, wobei das Pruningkriterium eine Wichtigkeit jedes Neurons angibt, das in dem trainierten neuronalen Netz enthalten ist und dem Schichtparameter zugeordnet ist. Das Verfahren umfasst die zusätzlichen Schritte des Identifizierens mindestens eines Neurons mit der geringsten Wchtigkeit und des Entfernens des mindestens einen Neurons aus dem trainierten Neuronalen Netz, um ein gepruntes Neuronales Netzwerk zu erzeugen. A method, a computer-readable medium and a system for checking a neural network are known from US 2018/0114114 A1. The method comprises the steps of receiving first order gradients of a cost function relative to slice parameters for a trained neural network and calculating a pruning criterion for each slice parameter based on the first order gradient corresponding to the slice parameter, the pruning criterion indicating an importance of each neuron, which is contained in the trained neural network and is assigned to the slice parameter. The method comprises the additional steps of identifying at least one neuron with the least importance and removing the at least one neuron from the trained neural network in order to generate a tested neural network.
Als weitere Kompressionsverfahren sind beispielsweise eine Quantisierung, ein Teacher- Student-Learning oder AutoML for Model Compression (AMC) bekannt. Im Rahmen der Quantisierung wird die Anzahl der Bits reduziert, welche nötig sind, um Parameter eines Neuronalen Netzes zu repräsentieren. Es werden also keine Parameter bzw. ganze Filter entfernt, sondern schneller zu verarbeitende Darstellungen der Parameter gewählt und somit eine effizientere Verarbeitung auf einer gegebenen Hardware erreicht. Beim Teacher-Student Learning werden statt einem einzelnen Neuronalen Netz zwei Modelle trainiert. Hierbei fungiert das erste als "Lehrer" (teacher) und das zweite als „Schüler“ (Student). Das Schüler-Modell wird hierbei ebenfalls mittels der Eingangsdaten des Lehrer-Modells trainiert. Dabei gibt das Lehrer- Modell in jedem Schritt Informationen an das Schüler-Modell weiter, sodass sich das Schüler- Modell an das Lehrer-Modell anpassen kann. In der Regel wird für das resultierende Schüler- Modell eine kleinere Architektur des Neuronalen Netzes verwendet. Beim AutoML for Model Compression (AMC) wird ein bereits trainiertes Neuronales Netz durch einen Agenten komprimiert, welcher durch die vorhandenen Schichten iteriert und von jeder Schicht verschiedene Kenngrößen erhält. Basierend auf diesen Kenngrößen gibt der Agent eine Anweisung (action), mit welcher Rate die jeweils betrachtete Schicht zu komprimieren ist. Wenn alle Schichten komprimiert sind, wird eine Auswertung des Modells auf Testdaten durchgeführt und an den Agenten verteilt (reward). Quantization, teacher-student learning or AutoML for Model Compression (AMC) are known as further compression methods. In the context of quantization, the number of bits is reduced which are necessary to represent parameters of a neural network. So no parameters or entire filters are removed, but representations of the parameters that can be processed more quickly are selected, thus achieving more efficient processing on a given hardware. In teacher-student learning, two models are trained instead of a single neural network. Here acts the first as a "teacher" and the second as a "student". The student model is also trained using the input data from the teacher model. The teacher model passes on information to the student model in every step so that the student model can adapt to the teacher model. As a rule, a smaller neural network architecture is used for the resulting student model. With AutoML for Model Compression (AMC), an already trained neural network is compressed by an agent, which iterates through the existing layers and receives different parameters from each layer. Based on these parameters, the agent issues an instruction (action) indicating the rate at which the layer under consideration is to be compressed. When all layers are compressed, an evaluation of the model on test data is carried out and distributed to the agent (reward).
Der Erfindung liegt die Aufgabe zu Grunde, ein Verfahren und eine Vorrichtung zum Komprimieren eines Neuronalen Netzes zu verbessern. The invention is based on the object of improving a method and a device for compressing a neural network.
Die Aufgabe wird erfindungsgemäß durch ein Verfahren mit den Merkmalen des Patentanspruchs 1, und eine Vorrichtung mit den Merkmalen des Patentanspruchs 9 gelöst. Vorteilhafte Ausgestaltungen der Erfindung ergeben sich aus den Unteransprüchen. The object is achieved according to the invention by a method with the features of claim 1 and a device with the features of claim 9. Advantageous refinements of the invention emerge from the subclaims.
Insbesondere wird ein Verfahren zum Komprimieren eines Neuronalen Netzes zur Verfügung gestellt, wobei ein trainiertes Neuronales Netz erhalten wird, wobei mindestens eine Strukturinformation des trainierten Neuronalen Netzes extrahiert oder erhalten wird, wobei das trainierte Neuronale Netz zum Komprimieren in Abhängigkeit der mindestens einen Strukturinformation in Teilmengen unterteilt wird, wobei für jede Teilmenge jeweils ein Kompressionsverfahren in Abhängigkeit von mindestens einer Eigenschaft der jeweiligen Teilmenge gewählt und verwendet wird, und wobei das komprimierte Neuronale Netz bereitgestellt wird. In particular, a method for compressing a neural network is provided, a trained neural network being obtained, with at least one structural information item of the trained neural network being extracted or obtained, the trained neural network subdividing into subsets for compression depending on the at least one structural information item is, wherein a compression method is selected and used for each subset depending on at least one property of the respective subset, and wherein the compressed neural network is provided.
Ferner wird insbesondere eine Vorrichtung zum Komprimieren eines Neuronalen Netzes geschaffen, umfassend eine Recheneinrichtung, wobei die Recheneinrichtung dazu eingerichtet ist, ein trainiertes Neuronales Netz zu erhalten, mindestens eine Strukturinformation des trainierten Neuronalen Netzes zu extrahieren oder zu erhalten, das trainierte Neuronale Netz zum Komprimieren in Abhängigkeit der mindestens einen Strukturinformation in Teilmengen zu unterteilen, und für jede Teilmenge jeweils ein Kompressionsverfahren in Abhängigkeit von mindestens einer Eigenschaft der jeweiligen Teilmenge zu wählen und zu verwenden, und das komprimierte Neuronale Netz bereitzustellen. Das Verfahren und die Vorrichtung ermöglichen es, ein Neuronales Netz verbessert zu komprimieren, da für einzelne Teilmengen des Neuronalen Netzes verschiedene Kompressionsverfahren verwendet werden können. Anders ausgedrückt: Es wird nicht ein Kompressionsverfahren für das gesamte Neuronale Netz verwendet, sondern es kann für jede Teilmenge des Neuronalen Netzes, das heißt für verschiedene Untereinheiten bzw. Unterblöcke etc., jeweils ein hierfür am besten geeignetes Kompressionsverfahren verwendet werden. Furthermore, in particular a device for compressing a neural network is created, comprising a computing device, the computing device being set up to receive a trained neural network, to extract or receive at least one structural information item of the trained neural network, the trained neural network for compression in To subdivide the at least one structural information into subsets as a function of the at least one structural information item, and to select and use a compression method for each subset as a function of at least one property of the respective subset, and to provide the compressed neural network. The method and the device make it possible to compress a neural network in an improved manner, since different compression methods can be used for individual subsets of the neural network. In other words: A compression method is not used for the entire neural network, but a compression method that is most suitable for this can be used for each subset of the neural network, that is, for different sub-units or sub-blocks etc.
Hierbei wird insbesondere davon ausgegangen, dass ein trainiertes Neuronales Netz, dessen Teilmengen jeweils lokal optimal komprimiert werden, insgesamt gegenüber einer Kompression des gesamten Neuronalen Netzes mittels nur eines einzigen Kompressionsverfahrens verbessert ist. Dies wird erreicht, indem ein fertig trainiertes Neuronales Netz zum Komprimieren in Abhängigkeit von mindestens einer Strukturinformation in Teilmengen unterteilt wird. Die mindestens eine Strukturinformation wird entweder aus einer Struktur des trainierten Neuronalen Netzes extrahiert oder die mindestens eine Strukturinformation wird bereitgestellt und erhalten. Die mindestens eine Strukturfunktion umfasst insbesondere eine Beschreibung des Neuronalen Netzes im Hinblick auf eine Struktur, das heißt der einzelnen Bestandteile, wie z.B. funktionale Blöcke, Schichten etc., und deren jeweilige Verknüpfung miteinander. Die mindestens eine Strukturinformation beschreibt daher insbesondere einen inneren strukturellen Aufbau des Neuronalen Netzes. Für jede der bestimmten Teilmengen wird, insbesondere aus einem Katalog von mehreren Kompressionsverfahren, ein jeweils zu verwendendes Kompressionsverfahren in Abhängigkeit von mindestens einer Eigenschaft der jeweiligen Teilmenge gewählt und verwendet. Das Komprimieren erfolgt dann insbesondere iterativ für jede der bestimmten Teilmengen. Hierzu wird jeweils eine Teilmenge des Neuronalen Netzes mittels des zugehörig gewählten Kompressionsverfahrens komprimiert, während die anderen Teilmengen des Neuronalen Netzes in dieser Zeit unverändert bleiben bzw. nicht komprimiert werden. Ist diese Teilmenge des Neuronalen Netzes komprimiert, so wird die nächste Teilmenge komprimiert, während die anderen Teilmengen unverändert bleiben. Sind alle Teilmengen mit dem jeweils gewählten Kompressionsverfahren komprimiert, ist das Komprimieren beendet. Das derart komprimierte Neuronale Netz wird anschließend bereitgestellt. Das Bereitstellen umfasst insbesondere ein Ausgeben des komprimierten Neuronalen Netzes, beispielsweise in Form eines die Struktur und die Gewichtungen bzw. Parameter des komprimierten Neuronalen Netzes beschreibenden digitalen Datensatzes. Das Bereitstellen kann auch ein Übermitteln des komprimierten Neuronalen Netzes an ein Steuergerät, beispielsweise eines Fahrzeugs, und/oder ein Hinterlegen des komprimierten Neuronalen Netzes in einem Speicher des Steuergeräts umfassen, sodass das komprimierte Neuronale Netz dort angewendet werden kann. Ein Vorteil des Verfahrens und der Vorrichtung ist, dass eine Kompression des Neuronalen Netzes verbessert werden kann, da für jede der bestimmten Teilmengen des Neuronalen Netzes das am besten geeignete Kompressionsverfahren gewählt und verwendet werden kann. Insbesondere kann hierdurch eine jeweils lokal optimale Kompression des Neuronalen Netzes erreicht werden. Hierdurch lassen sich für das gesamte komprimierte Neuronale Netz schnellere Inferenzzeiten, ein geringerer Bedarf an Speicherplatz und eine Reduktion der benötigten Rechenleistung und Rechenzeit während des Ausführens und in der Folge ein reduzierter Energiebedarf realisieren. Durch das gezielte Auswählen von Kompressionsverfahren für jede der Teilmengen kann insbesondere sichergestellt werden, dass eine im Neuronalen Netz vorhandene Redundanz minimiert wird. Durch die Möglichkeit, jedes der Kompressionsverfahren für die Teilmengen einzeln zu wählen, können beim Komprimieren zusätzlich unterschiedliche Schwerpunkte bzw. Zielsetzungen für jede der Teilmengen gesetzt werden (z.B. verringerte Laufzeit, eine verbesserte Stabilität etc.). In particular, it is assumed here that a trained neural network, the subsets of which are locally optimally compressed in each case, is overall improved compared to a compression of the entire neural network using only a single compression method. This is achieved by dividing a fully trained neural network into subsets for compression depending on at least one piece of structural information. The at least one piece of structural information is either extracted from a structure of the trained neural network or the at least one piece of structural information is provided and received. The at least one structure function includes, in particular, a description of the neural network with regard to a structure, that is to say the individual components, such as functional blocks, layers, etc., and their respective interconnection. The at least one structural information item therefore describes, in particular, an internal structural structure of the neural network. For each of the specific subsets, in particular from a catalog of several compression methods, a compression method to be used in each case is selected and used as a function of at least one property of the respective subset. The compression then takes place in particular iteratively for each of the specific subsets. For this purpose, a subset of the neural network is compressed by means of the corresponding selected compression method, while the other subsets of the neural network remain unchanged or are not compressed during this time. If this subset of the neural network is compressed, the next subset is compressed, while the other subsets remain unchanged. When all subsets have been compressed with the selected compression method, compression is finished. The neural network compressed in this way is then made available. The provision includes in particular outputting the compressed neural network, for example in the form of a digital data record describing the structure and the weightings or parameters of the compressed neural network. Providing can also include transmitting the compressed neural network to a control device, for example a vehicle, and / or storing the compressed neural network in a memory of the control device so that the compressed neural network can be used there. One advantage of the method and the device is that a compression of the neural network can be improved, since the most suitable compression method can be selected and used for each of the specific subsets of the neural network. In particular, this makes it possible to achieve locally optimal compression of the neural network in each case. As a result, faster inference times, less storage space requirements and a reduction in the computing power and computing time required during execution, and consequently a reduced energy requirement, can be achieved for the entire compressed neural network. The targeted selection of compression methods for each of the subsets can in particular ensure that any redundancy present in the neural network is minimized. The possibility of individually selecting each of the compression methods for the subsets means that different priorities or objectives can be set for each of the subsets when compressing (e.g. reduced runtime, improved stability, etc.).
Ein Neuronales Netz ist insbesondere ein Künstliches Neuronales Netz, insbesondere ein Faltungsnetz (engl convolutional neural network). Das Neuronale Netz ist insbesondere auf eine bestimmte Funktion trainiert, beispielsweise eine Wahrnehmung von Fußgängern in erfassten Kamerabildern. Das Neuronale Netz umfasst insbesondere mindestens eine Strukturinformation, die eine Struktur des Neuronalen Netzes beschreibt, und Parameter, die beispielsweise Gewichtungen von Aktivierungsfunktionen einzelner Neuronen oder von Filtern etc., beschreiben. Bei einem trainierten Neuronalen Netz wurden die Parameter insbesondere mit Hilfe eines Trainingsdatensatzes bestimmt. A neural network is in particular an artificial neural network, in particular a convolutional neural network. The neural network is trained in particular for a specific function, for example the perception of pedestrians in captured camera images. The neural network includes in particular at least one piece of structural information that describes a structure of the neural network, and parameters that describe, for example, weightings of activation functions of individual neurons or of filters, etc. In the case of a trained neural network, the parameters were determined in particular with the aid of a training data set.
Als Kompressionsverfahren können bekannte Kompressionsverfahren, wie z.B. Quantisierung, Teacher-Student-Learning und AutoML für Model Compression (AMC) verwendet werden. Known compression methods such as quantization, teacher-student learning and AutoML for Model Compression (AMC) can be used as the compression method.
Insbesondere können als Kompressionsverfahren Pruningverfahren verwendet werden. Prunen soll hierbei insbesondere bedeuten, dass die jeweils betrachtete Teilmenge des Neuronalen Netzes in seiner Struktur verändert, insbesondere beschnitten bzw. verkleinert wird. Dies erfolgt durch Entfernen von Elementen und/oder Teilen (z.B. Parameter oder Eingangskanäle etc.) der Elemente aus der Teilmenge des Neuronalen Netzes. Auf Grund der geänderten, insbesondere beschnittenen, Struktur, kann die geprunte Teilmenge des Neuronalen Netzes mit einer geringeren Rechenleistung und mit einem verringerten Speicherbedarf auf Eingangsdaten angewandt werden. Die geprunte Teilmenge des Neuronalen Netzes ist dann in ihrer Struktur komprimiert. Das Auswählen der zu prunenden Elemente der Teilmenge des Neuronalen Netzes kann auf verschiedene Arten erfolgen. In einer einfachen Ausführungsform werden beispielsweise diejenigen Elemente der Teilmenge des Neuronalen Netzes zum Prunen ausgewählt, die den geringsten Einfluss auf ein Ausgangsergebnis der Teilmenge des Neuronalen Netzes und/oder des Neuronalen Netzes aufweisen. Es kann ferner auch vorgesehen sein, dass Elemente ausgewählt werden, an deren Ausgängen Aktivierungen stets unterhalb eines vorgegebenen Schwellenwertes liegen. In particular, pruning methods can be used as the compression method. Pruning is intended to mean in particular that the structure of the particular subset of the neural network under consideration is changed, in particular trimmed or reduced in size. This is done by removing elements and / or parts (eg parameters or input channels etc.) of the elements from the subset of the neural network. Due to the changed, in particular trimmed, structure, the tested subset of the neural network can be applied to input data with a lower computing power and with a reduced memory requirement. The structure of the tested subset of the neural network is then compressed. The elements of the subset of the neural network to be checked can be selected in various ways. In a simple embodiment, for example, those elements of the subset of the neural network are selected for testing which have the least influence on an output result of the subset of the neural network and / or the neural network. Provision can furthermore also be made for elements to be selected whose outputs are always activations below a predetermined threshold value.
Die ausgewählten Elemente werden beispielsweise in Form einer Liste bzw. Tabelle oder Datenbank gesammelt und zusammengestellt. In der Liste bzw. Tabelle oder Datenbank ist beispielsweise eine eindeutige Kennzeichnung eines jeweils ausgewählten Elements vermerkt sowie gegebenenfalls weitere Eigenschaften oder Werte, wie beispielsweise eine maximale, minimale und/oder durchschnittliche Aktivierung des betrachteten Elements. Insbesondere umfasst die Liste bzw. die Tabelle oder Datenbank ein jeweils verwendetes Auswahlkriterium bzw. ein zu dem jeweils verwendeten Auswahlkriterium zugehörigen Wert des jeweiligen Elements. Insbesondere können die einzelnen Elemente in der Liste bzw. Tabelle oder Datenbank nach einer Rangfolge sortiert werden. Das Prunen wird dann in Abhängigkeit der Rangfolge durchgeführt. Beispielsweise wird eine vorgegebene Anzahl von obersten Rängen geprunt. The selected elements are collected and compiled, for example, in the form of a list or table or database. In the list or table or database, for example, an unambiguous identification of a respectively selected element is noted as well as possibly further properties or values, such as for example a maximum, minimum and / or average activation of the element under consideration. In particular, the list or the table or database includes a selection criterion used in each case or a value of the respective element associated with the selection criterion used in each case. In particular, the individual elements in the list or table or database can be sorted according to a ranking. The pruning is then carried out depending on the order of precedence. For example, a predetermined number of top ranks is checked.
Beispielhaft genannt seien die folgenden Pruningverfahren: The following pruning methods are mentioned as examples:
- Fisher-Pruning: Für jedes Filter des Neuronalen Netzes werden die Kosten des Entfernens berechnet und so ein Ranking der Kosten für alle Filter erstellt. Die Kosten werden hierbei definiert als die (gewichtete) Summe aus einer Schätzung für die entstehende Zunahme des Löss (Differenz zwischen inferierten Ausgangswerten und einer Grundwahrheit) und der Reduktion der rechnerischen Komplexität, wobei die Komplexität als Anzahl der benötigten floating point Operationen (FLOPS) beschrieben wird. - Fisher pruning: For each filter in the neural network, the costs of removing are calculated and a ranking of the costs for all filters is created. The costs are defined as the (weighted) sum of an estimate for the resulting increase in loess (difference between inferred initial values and a basic truth) and the reduction in computational complexity, with complexity being described as the number of floating point operations (FLOPS) required will.
- Magnitude Pruning: Hierbei werden Verknüpfungen mit den kleinsten Gewichtungen entfernt. - Magnitude pruning: This removes links with the smallest weightings.
- Similarity Pruning: Hierbei wird eine Rangfolge in Abhängigkeit von Ähnlichkeiten und Zusammenhängen erzeugt. Die Rangfolge begünstigt hierbei Filter, für die keine ähnlichen Filter existieren, gegenüber Filtern, für die ähnliche Filter existieren. Die Ähnlichkeit kann zum Beispiel mittels Jensen-Shannon-Divergenz, linearer Abhängigkeit, Cosinus-Ähnlichkeit oder Methoden der Anomalie-Erkennung bestimmt werden. - Similarity pruning: Here, a ranking is generated depending on similarities and contexts. The ranking favors filters for which none similar filters exist versus filters for which similar filters exist. The similarity can be determined, for example, by means of Jensen-Shannon divergence, linear dependency, cosine similarity or methods of anomaly detection.
Insbesondere ist vorgesehen, dass das komprimierte Neuronale Netz nach dem Komprimieren nachtrainiert wird. Hierzu werden dem komprimierten Neuronalen Netz erneut Trainingsdaten zugeführt und das komprimierte Neuronale Netz in an sich bekannter Weise trainiert. In particular, it is provided that the compressed neural network is retrained after compression. For this purpose, training data are again fed to the compressed neural network and the compressed neural network is trained in a manner known per se.
Teile der Vorrichtung, insbesondere die Recheneinrichtung, können einzeln oder zusammengefasst als eine Kombination von Hardware und Software ausgebildet sein, beispielsweise als Programmcode, der auf einem Mikrocontroller oder Mikroprozessor ausgeführt wird. Parts of the device, in particular the computing device, can be designed individually or collectively as a combination of hardware and software, for example as program code that is executed on a microcontroller or microprocessor.
Das Verfahren kann als computerimplementiertes Verfahren ausgeführt werden. Insbesondere kann das Verfahren mittels einer Datenverarbeitungseinrichtung ausgeführt werden. Die Datenverarbeitungseinrichtung umfasst insbesondere mindestens eine Recheneinrichtung und mindestens eine Speichereinrichtung. The method can be carried out as a computer-implemented method. In particular, the method can be carried out by means of a data processing device. The data processing device comprises in particular at least one computing device and at least one storage device.
Es wird insbesondere auch ein Computerprogramm geschaffen, umfassend Befehle, die bei der Ausführung des Computerprogramms durch einen Computer diesen veranlassen, die Verfahrensschritte des offenbarten Verfahrens gemäß einer beliebigen der beschriebenen Ausführungsformen auszuführen. In particular, a computer program is also created, comprising instructions which, when the computer program is executed by a computer, cause the computer to carry out the method steps of the disclosed method in accordance with any of the described embodiments.
Darüber hinaus wird insbesondere auch ein Datenträgersignal geschaffen, das das vorgenannte Computerprogramm überträgt. In addition, a data carrier signal is also created that transmits the aforementioned computer program.
In einer Ausführungsform ist vorgesehen, dass das Unterteilen und/oder Auswählen des Kompressionsverfahrens zumindest teilweise in Abhängigkeit von einer bereitgestellten Funktionalität der jeweiligen Teilmenge des trainierten Neuronalen Netzes erfolgt. In der Regel weist ein Neuronales Netz mehrere funktionale Bausteine auf, wie beispielsweise Merkmalsextraktoren (Feature-Extraktoren), Fusionsblöcke, Tiefenschätzer, Instanzsegmentierungen, optische Ströme, Regionsvorschläge, Klassifikatoren etc. Durch das Unterteilen und/oder Auswählen des Kompressionsverfahrens in Abhängigkeit von der jeweils von der Teilmenge bereitgestellten Funktionalität, kann das für jeden dieser Bausteine am besten geeignete Kompressionsverfahren verwendet werden. So hat sich zum Beispiel herausgestellt, dass das Verfahren des Fisher-Pruning besonders gut zum Komprimieren von Teilmengen eignet, die eine Funktionalität von Merkmalsextraktoren bereitstellen. Entsprechend wird beispielsweise für alle solche Teilmengen, die Merkmalsextraktoren bereitstellen, in dem trainierten Neuronalen Netz das Kompressionsverfahren des Fisher-Pruning ausgewählt und verwendet. Andere Teilmengen, die andere Funktionalitäten bereitstellen, können hingegen mit anderen Kompressionsverfahren komprimiert werden. In one embodiment it is provided that the subdivision and / or selection of the compression method takes place at least partially as a function of a functionality provided by the respective subset of the trained neural network. As a rule, a neural network has several functional components, such as feature extractors, fusion blocks, depth estimators, instance segmentations, optical streams, region proposals, classifiers, etc. By subdividing and / or selecting the compression method depending on the the subset of functionality provided, the most suitable compression method for each of these building blocks can be used. For example, it has been found that the Fisher pruning technique is particularly good at compressing Subsets that provide functionality of feature extractors are suitable. Correspondingly, for example, the Fisher pruning compression method is selected and used in the trained neural network for all such subsets that provide feature extractors. However, other subsets that provide other functionalities can be compressed using other compression methods.
In einer Ausführungsform ist vorgesehen, dass das Unterteilen und/oder Auswählen des Kompressionsverfahrens zumindest teilweise in Abhängigkeit von einer Position der jeweiligen Teilmenge innerhalb des trainierten Neuronalen Netzes erfolgt. Beispielsweise können Schichten des Neuronalen Netzes in Abhängigkeit einer Position innerhalb des Neuronalen Netzes zu Teilmengen zusammengefasst werden und anschließend mit einem jeweils gewählten Kompressionsverfahren komprimiert werden. Beispielsweise kann zwischen Anfangsschichten, mittleren Schichten und Ausgangsschichten unterschieden werden. In one embodiment it is provided that the subdivision and / or selection of the compression method takes place at least partially as a function of a position of the respective subset within the trained neural network. For example, layers of the neural network can be combined into subsets as a function of a position within the neural network and then compressed using a compression method selected in each case. For example, a distinction can be made between starting layers, middle layers and starting layers.
Ein jeweils am besten zum Komprimieren einer betrachteten Teilmenge des Neuronalen Netzes geeignetes Kompressionsverfahren kann insbesondere empirisch ermittelt werden, indem unterschiedliche Kompressionsverfahren im Hinblick auf ein gewünschtes Ergebnis (z.B. eine benötigte Rechenleistung und/oder eine Speicherbedarf und/oder eine funktionale Güte etc.) miteinander verglichen werden. Aus den Vergleichsergebnissen lassen sich dann Abhängigkeiten und Regeln darüber ableiten, welche Kompressionsverfahren besonders für bestimmte Arten und/oder Positionen von Teilmengen geeignet sind und welche nicht. A compression method that is best suited for compressing a subset of the neural network under consideration can be determined empirically in particular by comparing different compression methods with one another with regard to a desired result (e.g. a required computing power and / or a memory requirement and / or a functional quality, etc.) will. From the comparison results, it is then possible to derive dependencies and rules about which compression methods are particularly suitable for certain types and / or positions of subsets and which are not.
In einer Ausführungsform ist vorgesehen, dass beim Auswählen eines jeweiligen Kompressionsverfahrens für die bestimmten Teilmengen ein heuristisches Verfahren verwendet wird. Die Heuristiken können hierbei beispielsweise auf Grundlage der voranstehend beschriebenen empirischen Versuchsreihen bestimmt werden. Insbesondere wird hierbei durch eine Heuristik ein zu erwartender Effekt eines Kompressionsverfahrens in Bezug auf eine Laufzeit und/oder einen Energiebedarf und/oder einen Speicherbedarf und/oder in Bezug auf eine Position und/oder eine Größe der zu komprimierenden Teilmenge beschrieben. Es kann vorgesehen sein, dass die Heuristiken durch wiederholtes Anwenden des Verfahrens und hierbei gewonnener Erkenntnisse schrittweise angepasst und/oder verbessert werden. Ferner ist es möglich, die Heuristiken zumindest teilweise von menschlichen Experten erstellen und/oder überprüfen und/oder anpassen zu lassen. In one embodiment it is provided that a heuristic method is used when selecting a respective compression method for the specific subsets. The heuristics can be determined on the basis of the empirical test series described above, for example. In particular, a heuristic describes an expected effect of a compression method with regard to a running time and / or an energy requirement and / or a memory requirement and / or with regard to a position and / or a size of the subset to be compressed. Provision can be made for the heuristics to be adapted and / or improved step-by-step by repeated application of the method and the knowledge gained in this way. It is also possible to have the heuristics at least partially created and / or checked and / or adapted by human experts.
Es kann vorgesehen sein, dass beim Auswählen der Kompressionsverfahren einzelne Einflussparameter gewichtet berücksichtigt werden. Insbesondere können die Heuristiken mit Hilfe von gewichteten Einflussparametern ein jeweiliges Ergebnis liefern. Dies ist insbesondere von Vorteil, wenn keine eindeutigen Aussagen zu einem am besten geeigneten Kompressionsverfahren vorhanden oder möglich sind. Die jeweils miteinander zu vergleichenden Kompressionsverfahren werden dann beispielsweise auf Grundlage einer Gewichtungsfunktion miteinander über einen jeweiligen Summenwert verglichen und ausgewählt. Provision can be made for individual influencing parameters to be weighted into account when selecting the compression method. In particular, the heuristics can be used with Deliver a respective result with the help of weighted influencing parameters. This is particularly advantageous if no clear statements about the most suitable compression method are available or possible. The compression methods to be compared with one another are then compared with one another using a respective sum value, for example on the basis of a weighting function, and selected.
In einer Ausführungsform ist vorgesehen, dass das jeweilige Kompressionsverfahren in Abhängigkeit von mindestens einem Optimierungskriterium durchgeführt wird. Optimierungskriterien sind hierbei beispielsweise die folgenden: eine funktionale Güte bzw. Genauigkeit des (komprimierten) Neuronalen Netzes, eine benötigte Rechenleistung (der betrachteten Teilmenge) und/oder ein benötigter Speicherplatz (der betrachteten Teilmenge).In one embodiment it is provided that the respective compression method is carried out as a function of at least one optimization criterion. Optimization criteria here are, for example, the following: a functional quality or accuracy of the (compressed) neural network, a required computing power (of the subset considered) and / or a required storage space (the subset considered).
Es ist hierbei insbesondere vorgesehen, dass die jeweils einzeln durchgeführten Kompressionen der Teilmengen des Neuronalen Netzes jeweils nach dem mindestens einen Optimierungskriterium erfolgt. Insbesondere wird beim Komprimieren einer Teilmenge eine Optimierung nach dem mindestens einen Optimierungskriterium des gesamten Neuronalen Netzes betrachtet. Ist ein Optimierungskriterium beispielsweise eine benötigte Laufzeit, so wird die Teilmenge mittels des zugehörigen Kompressionsverfahrens komprimiert und bei jedem Iterationsschritt wird eine Laufzeit des Neuronalen Netzes bestimmt. Das Kompressionsverfahren wird dann derart ausgeführt bzw. parametriert, dass diese Laufzeit optimiert, insbesondere minimiert, wird. In particular, it is provided here that the compressions of the subsets of the neural network that are carried out individually are each carried out according to the at least one optimization criterion. In particular, when compressing a subset, an optimization according to the at least one optimization criterion of the entire neural network is considered. If an optimization criterion is, for example, a required running time, the subset is compressed using the associated compression method and a running time of the neural network is determined for each iteration step. The compression method is then carried out or parameterized in such a way that this runtime is optimized, in particular minimized.
Es kann vorgesehen sein, dass das mindestens eine Optimierungskriterium in Abhängigkeit von mindestens einer Eigenschaft eines Steuergeräts gewählt und/oder festgelegt wird, auf dem nach dem Komprimieren das komprimierte Neuronale Netz ausgeführt werden soll. Die Eigenschaften können beispielsweise eine zur Verfügung stehende Rechenleistung und/oder einen zur Verfügung stehenden Speicherplatz umfassen. Hierbei kann vorgesehen sein, dass diese Eigenschaften vor dem Komprimieren bei dem Steuergerät abgefragt werden. It can be provided that the at least one optimization criterion is selected and / or specified as a function of at least one property of a control device on which the compressed neural network is to be executed after compression. The properties can include, for example, an available computing power and / or an available memory space. It can be provided here that these properties are queried from the control unit before the compression.
In einer Ausführungsform ist vorgesehen, dass das Auswählen und/oder das Ausführen des jeweiligen Kompressionsverfahrens in Abhängigkeit von mindestens einer geographischen Information und/oder mindestens einer Kontextinformation erfolgt. Hierdurch kann das Kompressionsverfahren beispielsweise an geographische Gegebenheiten, wie z.B. bestimmte Merkmale in der Umgebung, die mittels des Neuronalen Netzes verarbeitet werden, und/oder an einen situativen Kontext, wie beispielsweise einen Umfeldkontext (z.B. Stadt, Autobahn, Landstraße, Parkhaus etc.), angepasst werden. In einer Ausführungsform ist vorgesehen, dass das Komprimieren unter Berücksichtigung von erfassten Sensordaten erfolgt. Hierdurch können Eigenschaften der Sensordaten berücksichtigt werden. Insbesondere können hierdurch Kompressionsverfahren gewählt werden, die für eine bestimmte Art von Sensordaten inhaltlich und/oder strukturell besser geeignet sind. In one embodiment it is provided that the selection and / or the execution of the respective compression method takes place as a function of at least one piece of geographic information and / or at least one piece of context information. In this way, the compression method can be adapted to geographical conditions, such as certain features in the environment that are processed by means of the neural network, and / or to a situational context, such as an environmental context (e.g. city, motorway, country road, parking garage, etc.), be adjusted. In one embodiment it is provided that the compression takes place while taking into account acquired sensor data. This allows properties of the sensor data to be taken into account. In this way, in particular, compression methods can be selected which are more suitable in terms of content and / or structure for a certain type of sensor data.
Insbesondere kann vorgesehen sein, bei einem Einsatz des trainierten Neuronalen Netzes in einer Fahrzeugflotte aus Fahrzeugen das Komprimieren des Neuronalen Netzes jeweils nur auf bestimmte Fahrzeuge der Fahrzeugflotte zu beschränken. Hierbei kann insbesondere eine geographisch, beispielsweise regional, beschränkte und/oder angepasste Kompression des Neuronalen Netzes erfolgen. Hierbei wird das Komprimieren beispielsweise im Fahrzeug in Abhängigkeit einer geographischen Position und/oder mindestens einer Kontextinformation durchgeführt. Auf diese Weise können fahrzeugindividuell komprimierte Neuronale Netze bereitgestellt werden. In particular, it can be provided that when the trained neural network is used in a vehicle fleet of vehicles, the compression of the neural network is only limited to specific vehicles in the vehicle fleet. In particular, a geographically, for example regionally, restricted and / or adapted compression of the neural network can take place here. In this case, the compression is carried out, for example, in the vehicle as a function of a geographical position and / or at least one piece of context information. In this way, vehicle-specific compressed neural networks can be provided.
In einer Ausführungsform ist vorgesehen, dass das Neuronale Netz eine Funktion für das automatisierte Fahren eines Fahrzeugs und/oder für eine Fahrerassistenz des Fahrzeugs und/oder für eine Umfelderfassung und/oder Umfeldwahrnehmung bereitstellt. In one embodiment it is provided that the neural network provides a function for the automated driving of a vehicle and / or for a driver assistance of the vehicle and / or for a surrounding area detection and / or surrounding area perception.
Ein Fahrzeug ist insbesondere ein Kraftfahrzeug. Ein Fahrzeug kann prinzipiell jedoch auch ein anderes Land-, Luft-, Wasser-, Schienen- oder Raumfahrzeug sein. A vehicle is in particular a motor vehicle. In principle, however, a vehicle can also be another land, air, water, rail or space vehicle.
Weitere Merkmale zur Ausgestaltung der Vorrichtung ergeben sich aus der Beschreibung von Ausgestaltungen des Verfahrens. Die Vorteile der Vorrichtung sind hierbei jeweils die gleichen wie bei den Ausgestaltungen des Verfahrens. Further features for the configuration of the device emerge from the description of configurations of the method. The advantages of the device are in each case the same as in the embodiments of the method.
Nachfolgend wird die Erfindung anhand bevorzugter Ausführungsbeispiele unter Bezugnahme auf die Figuren näher erläutert. Hierbei zeigen: The invention is explained in more detail below on the basis of preferred exemplary embodiments with reference to the figures. Here show:
Fig. 1 eine schematische Darstellung einer Ausführungsform der Vorrichtung zum Komprimieren eines Neuronalen Netzes; 1 shows a schematic representation of an embodiment of the device for compressing a neural network;
Fig. 2 ein schematisches Flussdiagramm zur Verdeutlichung von Ausführungsformen des Verfahrens zum Komprimieren eines Neuronalen Netzes. In Fig. 1 ist eine schematische Darstellung einer Ausführungsform der Vorrichtung 1 zum Komprimieren eines Neuronalen Netzes 10 gezeigt. Die Vorrichtung 1 umfasst eine Recheneinrichtung 2 und eine Speichereinrichtung 3. Die Recheneinrichtung 2 kann auf die Speichereinrichtung 3 zugreifen und Rechenoperationen auf darin hinterlegten Daten ausführen. Die Recheneinrichtung 2 führt das in dieser Offenbarung beschriebene Verfahren aus. 2 shows a schematic flow diagram to illustrate embodiments of the method for compressing a neural network. 1 shows a schematic representation of an embodiment of the device 1 for compressing a neural network 10. The device 1 comprises a computing device 2 and a storage device 3. The computing device 2 can access the storage device 3 and perform arithmetic operations on data stored therein. The computing device 2 carries out the method described in this disclosure.
Der Recheneinrichtung 2 wird ein trainiertes Neuronales Netz 10 zugeführt, wobei die Recheneinrichtung 2 das trainierte Neuronale Netz 10 erhält. Insbesondere empfängt die Recheneinrichtung 2 das trainierte Neuronale Netz 10 mittels einer hierfür eingerichteten Schnittstelle (nicht gezeigt). Es ist insbesondere vorgesehen, dass das trainierte Neuronale Netz 10 eine Funktion für das automatisierte Fahren eines Fahrzeugs und/oder für eine Fahrerassistenz des Fahrzeugs und/oder für eine Umfelderfassung und/oder Umfeldwahrnehmung bereitstellt. A trained neural network 10 is fed to the computing device 2, the computing device 2 receiving the trained neural network 10. In particular, the computing device 2 receives the trained neural network 10 by means of an interface set up for this purpose (not shown). In particular, it is provided that the trained neural network 10 provides a function for automated driving of a vehicle and / or for driver assistance of the vehicle and / or for environment detection and / or environment perception.
Die Recheneinrichtung 2 extrahiert oder erhält mindestens eine Strukturinformation des trainierten Neuronalen Netzes 10. Diese mindestens eine Strukturinformation umfasst insbesondere eine Information zum strukturellen Aufbau des trainierten Neuronalen Netzes 10. In Abhängigkeit der mindestens einen Strukturinformation wird das trainierte Neuronale Netz 10 in Teilmengen unterteilt. The computing device 2 extracts or receives at least one piece of structural information from the trained neural network 10. This at least one piece of structural information includes, in particular, information about the structure of the trained neural network 10. The trained neural network 10 is divided into subsets as a function of the at least one structural information item.
Für jede Teilmenge wählt die Recheneinrichtung 2 jeweils ein Kompressionsverfahren in Abhängigkeit von mindestens einer Eigenschaft der jeweiligen Teilmenge aus. Eine solche Eigenschaft kann beispielsweise eine Funktionalität oder eine Position der Teilmenge innerhalb des Neuronalen Netzes 10 sein. Die jeweilige Teilmenge des Neuronalen Netzes 10 wird mittels des jeweils gewählten Kompressionsverfahrens komprimiert. For each subset, the computing device 2 selects a compression method depending on at least one property of the respective subset. Such a property can be a functionality or a position of the subset within the neural network 10, for example. The respective subset of the neural network 10 is compressed by means of the compression method selected in each case.
Das Komprimieren wird nacheinander für alle Teilmengen mittels des jeweils gewählten Kompressionsverfahrens durchgeführt, wobei beim Komprimieren einer Teilmenge die anderen Teilmengen, das heißt sowohl bereits komprimierte als auch noch nicht komprimierte, jeweils unverändert bleiben. Zum Beurteilen eines Effektes des Komprimierens einzelner Teilmengen wird insbesondere in jedem Fall das gesamte Neuronale Netz betrachtet. The compression is carried out one after the other for all subsets by means of the respectively selected compression method, the other subsets, that is to say both already compressed and not yet compressed, each remaining unchanged when compressing a subset. To assess the effect of compressing individual subsets, the entire neural network is particularly considered in each case.
Sind alle Teilmengen mittels des jeweils gewählten Kompressionsverfahrens komprimiert, so wird das komprimierte Neuronale Netz 11 bereitgestellt, und insbesondere in Form eines digitalen Datenpakets ausgegeben. Es kann vorgesehen sein, dass das komprimierte Neuronale Netz 11, insbesondere als digitales Datenpaket, an ein Steuergerät 51, beispielsweise eines Fahrzeugs, übermittelt wird, und dort in einen Speicher geladen wird. Das Steuergerät 51 kann anschließend das komprimierte Neuronale Netz 11 ausführen und beispielsweise auf erfassten Sensordaten anwenden. Hierbei können aufgrund der Kompression eine benötigte Laufzeit, eine benötigte Rechenleistung und/oder ein Speicherbedarf verringert werden. If all subsets are compressed by means of the compression method selected in each case, the compressed neural network 11 is provided and, in particular, output in the form of a digital data packet. It can be provided that the compressed neural network 11, in particular as a digital data packet, is transmitted to a control device 51, for example a vehicle, and is loaded into a memory there. The control device 51 can then execute the compressed neural network 11 and apply it to acquired sensor data, for example. Due to the compression, a required running time, a required computing power and / or a memory requirement can be reduced.
In Fig. 2 ist ein schematisches Flussdiagramm zur Verdeutlichung von Ausführungsformen des Verfahrens zum Komprimieren eines Neuronalen Netzes 10 gezeigt. Es ist vorgesehen, dass das Verfahren in einem Backendserver 20 ausgeführt wird. Der Backendserver 20 ist beispielsweise wie die in der Fig. 1 gezeigte Vorrichtung 1 ausgebildet. FIG. 2 shows a schematic flow diagram to illustrate embodiments of the method for compressing a neural network 10. It is provided that the method is carried out in a back-end server 20. The backend server 20 is designed, for example, like the device 1 shown in FIG. 1.
Dem Backendserver 20 werden ein trainiertes Neuronales Netz 10 und Parameter 12 zugeführt, wobei die Parameter 12 das Komprimieren steuern und beispielsweise mindestens ein Optimierungskriterium 13 umfassen. A trained neural network 10 and parameters 12 are fed to the backend server 20, the parameters 12 controlling the compression and including at least one optimization criterion 13, for example.
Es ist hierbei insbesondere vorgesehen, dass das trainierte Neuronale Netz 10 eine Funktion für das automatisierte Fahren eines Fahrzeugs und/oder für eine Fahrerassistenz des Fahrzeugs und/oder für eine Umfelderfassung und/oder Umfeldwahrnehmung bereitstellt. It is provided in particular that the trained neural network 10 provides a function for the automated driving of a vehicle and / or for driver assistance of the vehicle and / or for environment detection and / or environment perception.
Das Komprimieren wird mittels einer vom Backendserver 20 bereitgestellten Kontrollfunktion 21 gesteuert. Die Kontrollfunktion 21 erhält hierzu die Parameter 12. Die Kontrollfunktion 21 organisiert das Komprimieren des trainierten Neuronalen Netzes 10 und hat hierzu Einblick in sämtliche Zwischenergebnisse. Insbesondere organisiert die Kontrollfunktion 21 das iterative Komprimieren. The compression is controlled by means of a control function 21 provided by the backend server 20. The control function 21 receives the parameters 12 for this purpose. The control function 21 organizes the compression of the trained neural network 10 and has an insight into all intermediate results for this purpose. In particular, the control function 21 organizes the iterative compression.
Mittels einer Splitterfunktion 22 wird das trainierte Neuronale Netz 10 in mehrere Teilmengen I, II, III, IV, V unterteilt. Dies erfolgt in Abhängigkeit von mindestens einer Strukturinformation 14, welche aus dem trainierten Neuronalen Netz 10 extrahiert wird oder auf andere Weise erhalten, beispielsweise separat vom trainierten Neuronalen Netz 10 empfangen, wird. The trained neural network 10 is subdivided into several subsets I, II, III, IV, V by means of a splitter function 22. This takes place as a function of at least one piece of structural information 14, which is extracted from the trained neural network 10 or obtained in some other way, for example received separately from the trained neural network 10.
Es kann hierbei vorgesehen sein, dass das Unterteilen zumindest teilweise in Abhängigkeit von einer bereitgestellten Funktionalität der jeweiligen Teilmenge I, II, III, IV, V des trainierten Neuronalen Netzes 10 erfolgt. Eine Funktionalität kann hierbei beispielsweise die folgende sein: Merkmalsextraktoren, Fusionsblöcke, Tiefenschätzer, Instanzsegmentierung, optische Ströme, Regionsvorschläge, Klassifikatoren etc. Für die jeweiligen Funktionalitäten werden dann jeweils zugehörige, diese Funktionalitäten bereitstellende, Teilmengen aus Elementen des Neuronalen Netzes 10 gebildet. Provision can be made here for the subdivision to take place at least partially as a function of a provided functionality of the respective subset I, II, III, IV, V of the trained neural network 10. A functionality can be, for example, the following: feature extractors, fusion blocks, depth estimators, instance segmentation, optical streams, Proposals for regions, classifiers, etc. For the respective functionalities, associated subsets, which provide these functionalities, are then formed from elements of the neural network 10.
Alternativ oder zusätzlich kann vorgesehen sein, dass das Unterteilen zumindest teilweise in Abhängigkeit von einer Position der jeweiligen Teilmenge I, II, III, IV, V innerhalb des trainierten Neuronalen Netzes 10 erfolgt. Die Position definiert beispielsweise, an welcher Stelle einer Verarbeitungskette innerhalb des trainierten Neuronalen Netzes 10 die jeweils betrachtete Teilmenge I, II, III, IV, V sich befindet. In einem einfachen Beispiel können beispielsweise Anfangsschichten, Mittelschichten und Endschichten unterschieden werden. Alternatively or additionally, it can be provided that the subdivision takes place at least partially as a function of a position of the respective subset I, II, III, IV, V within the trained neural network 10. The position defines, for example, at which point in a processing chain within the trained neural network 10 the respectively considered subset I, II, III, IV, V is located. In a simple example, a distinction can be made, for example, at the beginning, middle and end shifts.
Eine Auswahlfunktion 23 wählt für jede der Teilmengen I, II, III, IV, V jeweils ein Kompressionsverfahren in Abhängigkeit von mindestens einer Eigenschaft der jeweiligen Teilmenge I, II, III, IV, V aus einem Katalog 24 aus. Hierbei ist insbesondere vorgesehen, dass beim Auswählen eines jeweiligen Kompressionsverfahrens für die bestimmten Teilmengen I, II, III, IV, V ein heuristisches Verfahren verwendet wird. Die hierbei verwendeten Heuristiken werden beispielsweise empirisch gewonnen, das heißt mittels gezielter Versuchsreihen, bei denen für verschiedene Teilmengen verschiedene Kompressionsverfahren verwendet werden, deren Effekt anschließend nach bestimmten Zielkriterien ausgewertet werden. A selection function 23 selects a compression method for each of the subsets I, II, III, IV, V as a function of at least one property of the respective subsets I, II, III, IV, V from a catalog 24. In particular, it is provided here that a heuristic method is used when selecting a respective compression method for the specific subsets I, II, III, IV, V. The heuristics used here are obtained empirically, for example, that is, by means of targeted test series in which different compression methods are used for different subsets, the effect of which is then evaluated according to specific target criteria.
Der Katalog 24 von Kompressionsverfahren umfasst insbesondere Pruningverfahren, kann aber auch andere Arten von Kompressionsverfahren umfassen. Als Pruningverfahren seien beispielshaft genannt: Fisher Pruning, Magnitude Pruning und Similarity Pruning. Als sonstige Kompressionsverfahren seien beispielhaft genannt: Quantisierung, Teacher-Student Learning und AutoML for Model Compression (AMC). The catalog 24 of compression methods includes, in particular, pruning methods, but can also include other types of compression methods. Examples of pruning methods are: Fisher pruning, magnitude pruning and similarity pruning. Examples of other compression methods are: quantization, teacher-student learning and AutoML for Model Compression (AMC).
Sind die jeweiligen Kompressionsverfahren ausgewählt, so werden die Teilmengen I, II, III, IV, V jeweils einzeln mittels zentraler Kompressionsmodule 25 komprimiert. Dies erfolgt insbesondere, indem stets jeweils eine der Teilmengen I, II, III, IV, V komprimiert wird, während die anderen Teilmengen I, II, III, IV, V unverändert bleiben. Um das jeweilige Kompressionsergebnis zu beurteilen, wird das gesamte Neuronale Netz 10 betrachtet. Ist eine Teilmenge I, II, III, IV, V komprimiert, so werden die restlichen Teilmengen I, II, III, IV, V jeweils einzeln komprimiert. Im gezeigten Beispiel könnte die folgende Reihenfolge beim Komprimieren verwendet werden: zuerst Teilmenge I, dann Teilmenge II, dann Teilmenge III, dann Teilmenge IV und zuletzt Teilmenge V. Es kann vorgesehen sein, dass das Komprimieren, insbesondere das Prunen, unter Berücksichtigung von Trainingsdaten 30 erfolgt. Dies ermöglicht es, Eigenschaften der Trainingsdaten 30 bzw. einer zugehörigen Datendomäne zu berücksichtigen. Once the respective compression methods have been selected, the subsets I, II, III, IV, V are each compressed individually by means of central compression modules 25. This is done in particular by always compressing one of the subsets I, II, III, IV, V, while the other subsets I, II, III, IV, V remain unchanged. In order to assess the respective compression result, the entire neural network 10 is considered. If a subset I, II, III, IV, V is compressed, the remaining subsets I, II, III, IV, V are each compressed individually. In the example shown, the following sequence could be used for compression: first subset I, then subset II, then subset III, then subset IV and finally subset V. It can be provided that the compression, in particular the pruning, takes place while taking training data 30 into account. This makes it possible to take into account properties of the training data 30 or an associated data domain.
Sind alle Teilmengen I, II, III, IV, V komprimiert, so kann das komprimierte Neuronale Netz 11 mittels einer Finetuningfunktion 26 nachtrainiert werden. Hierzu werden die Trainingsdaten 30 verwendet. If all subsets I, II, III, IV, V are compressed, the compressed neural network 11 can be retrained by means of a fine-tuning function 26. The training data 30 are used for this purpose.
Das komprimierte Neuronale Netz 11 wird anschließend bereitgestellt, und insbesondere in Form eines digitalen Datenpakets ausgegeben. Anschließend kann es beispielsweise in einen Speicher eines Steuergeräts geladen werden, sodass eine Funktionalität des komprimierten Neuronalen Netzes 11 von dem Steuergerät bereitgestellt werden kann. The compressed neural network 11 is then made available and, in particular, output in the form of a digital data packet. It can then be loaded into a memory of a control device, for example, so that functionality of the compressed neural network 11 can be provided by the control device.
Es kann alternativ vorgesehen sein, dass das trainierte Neuronale Netz 10 nach dem Unterteilen und Auswählen der jeweiligen Kompressionsverfahren außerhalb des Backendservers 20, insbesondere in einem Fahrzeug 50 einer Fahrzeugflotte, komprimiert wird. Die jeweils ausgewählten Kompressionsverfahren werden an verteilte Kompressionsmodule 27 übermittelt, beispielsweise über eine Luftschnittstelle (nicht gezeigt). Das Komprimieren wird dann mittels der verteilten Kompressionsmodule 27 durchgeführt. Ein Vorteil hierbei ist, dass Sensordaten 31 aus einer aktuellen Sensordatendomäne, beispielsweise aus einem aktuellen Umfeld oder Kontext (z.B. eines Fahrzeugs), beim Komprimieren berücksichtigt werden können. Beispielsweise kann eine beim Prunen für Aktivierungen von Elementen der Teilmenge I, II, III, IV, V des trainierten Neuronalen Netzes 10 erstellte Rangfolge ausgehend von den Sensordaten 31 erstellt werden, die dem Neuronalen Netz 10 als Eingangsdaten zugeführt werden. Das Komprimieren kann dann gezielt für eine zugehörige Sensordatendomäne erfolgen. Das derart mittels der verteilten Kompressionsmodule 27 komprimierte Neuronale Netz 11 wird anschließend mittels der Finetuningfunktion 26 nachtrainiert und bereitgestellt. Alternatively, provision can be made for the trained neural network 10 to be compressed outside of the backend server 20, in particular in a vehicle 50 of a vehicle fleet, after the subdivision and selection of the respective compression method. The compression methods selected in each case are transmitted to distributed compression modules 27, for example via an air interface (not shown). The compression is then carried out by means of the distributed compression modules 27. One advantage here is that sensor data 31 from a current sensor data domain, for example from a current environment or context (e.g. a vehicle), can be taken into account during compression. For example, a ranking created when checking for activations of elements of the subset I, II, III, IV, V of the trained neural network 10 can be created on the basis of the sensor data 31 which are fed to the neural network 10 as input data. The compression can then take place specifically for an associated sensor data domain. The neural network 11 compressed in this way by means of the distributed compression modules 27 is then retrained and made available by means of the fine-tuning function 26.
Insbesondere ist vorgesehen, dass das jeweilige Kompressionsverfahren in Abhängigkeit von mindestens einem Optimierungskriterium 13 durchgeführt wird. Das mindestens eine Optimierungskriterium 13 kann beispielsweise eines oder mehrere der folgenden umfassen: eine funktionale Güte bzw. Genauigkeit des (komprimierten) Neuronalen Netzes 11, eine benötigte Rechenleistung (der betrachteten Teilmenge I, II, III, IV, V) und/oder ein benötigter Speicherplatz (der betrachteten Teilmenge I, II, III, IV, V). Das trainierte Neuronale Netz 10 kann hierdurch gezielt unter Beachtung vorgegebener Randbedingungen optimiert werden. Ferner kann vorgesehen sein, dass das Auswählen und/oder das Ausführen des jeweiligen Kompressionsverfahrens in Abhängigkeit von mindestens einer geographischen Information 15 und/oder mindestens einer Kontextinformation 16 erfolgt. In particular, it is provided that the respective compression method is carried out as a function of at least one optimization criterion 13. The at least one optimization criterion 13 can include, for example, one or more of the following: a functional quality or accuracy of the (compressed) neural network 11, a required computing power (the considered subset I, II, III, IV, V) and / or a required one Storage space (of the considered subset I, II, III, IV, V). The trained neural network 10 can hereby be optimized in a targeted manner taking into account given boundary conditions. Furthermore, it can be provided that the selection and / or the execution of the respective compression method takes place as a function of at least one piece of geographic information 15 and / or at least one piece of context information 16.
Es kann vorgesehen sein, dass das mindestens eine Optimierungskriterium 13 in Abhängigkeit von Eigenschaften eines Steuergerätes festgelegt wird, auf dem das komprimierte Neuronale Netz 11 anschließend ausgeführt werden soll. Solche Eigenschaften können beispielsweise eine bereitgestellte Rechenleistung oder ein zur Verfügung stehender Speicherplatz sein. It can be provided that the at least one optimization criterion 13 is defined as a function of properties of a control device on which the compressed neural network 11 is then to be executed. Such properties can be, for example, a provided computing power or an available memory space.
Bezugszeichenliste List of reference symbols
Vorrichtung Recheneinrichtung Speichereinrichtung trainiertes Neuronales Netz komprimiertes Neuronales Netz Parameter Device Computing device Storage device Trained neural network Compressed neural network Parameters
Optimierungskriterium Optimization criterion
Strukturinformation geographische Information Structural information geographic information
Kontextinformation Context information
Backendserver Backend server
Kontrollfunktion Control function
Splitterfunktion Splinter function
Auswahlfunktion Selection function
Katalog von Kompressionsverfahren zentrales KompressionsmodulCatalog of compression methods central compression module
Finetuningfunktion verteiltes Kompressionsmodul Fine tuning function distributed compression module
Trainingsdaten Training data
Sensordaten Sensor data
Fahrzeug vehicle
Steuergerät Control unit
Teilmengen Subsets

Claims

Patentansprüche Claims
1. Verfahren zum Komprimieren eines Neuronalen Netzes (10), wobei ein trainiertes Neuronales Netz (10) erhalten wird, wobei mindestens eine Strukturinformation (14) des trainierten Neuronalen Netzes (10) extrahiert oder erhalten wird, wobei das trainierte Neuronale Netz (10) zum Komprimieren in Abhängigkeit der mindestens einen Strukturinformation (14) in Teilmengen (I, II, III, IV, V) unterteilt wird, wobei für jede Teilmenge (I, II, III, IV, V) jeweils ein Kompressionsverfahren in Abhängigkeit von mindestens einer Eigenschaft der jeweiligen Teilmenge (I, II, III, IV, V) gewählt und verwendet wird, und wobei das komprimierte Neuronale Netz (11) bereitgestellt wird. 1. A method for compressing a neural network (10), wherein a trained neural network (10) is obtained, wherein at least one piece of structural information (14) of the trained neural network (10) is extracted or obtained, the trained neural network (10) for compression is subdivided into subsets (I, II, III, IV, V) as a function of the at least one structural information item (14), with a compression method depending on at least one for each subset (I, II, III, IV, V) Property of the respective subset (I, II, III, IV, V) is selected and used, and the compressed neural network (11) is provided.
2. Verfahren nach Anspruch 1, dadurch gekennzeichnet, dass das Unterteilen und/oder Auswählen des Kompressionsverfahrens zumindest teilweise in Abhängigkeit von einer bereitgestellten Funktionalität der jeweiligen Teilmenge (I, II, III, IV, V) des trainierten Neuronalen Netzes (10) erfolgt. 2. The method according to claim 1, characterized in that the subdivision and / or selection of the compression method takes place at least partially as a function of a provided functionality of the respective subset (I, II, III, IV, V) of the trained neural network (10).
3. Verfahren nach Anspruch 1 oder 2, dadurch gekennzeichnet, dass das Unterteilen und/oder Auswählen des Kompressionsverfahrens zumindest teilweise in Abhängigkeit von einer Position der jeweiligen Teilmenge (I, II, III, IV, V) innerhalb des trainierten Neuronalen Netzes (10) erfolgt. 3. The method according to claim 1 or 2, characterized in that the subdividing and / or selecting the compression method is at least partially dependent on a position of the respective subset (I, II, III, IV, V) within the trained neural network (10) he follows.
4. Verfahren nach einem der vorangegangenen Ansprüche, dadurch gekennzeichnet, dass beim Auswählen eines jeweiligen Kompressionsverfahrens für die bestimmten Teilmengen (I, II, III, IV, V) ein heuristisches Verfahren verwendet wird. 4. The method according to any one of the preceding claims, characterized in that a heuristic method is used when selecting a respective compression method for the specific subsets (I, II, III, IV, V).
5. Verfahren nach einem der vorangegangenen Ansprüche, dadurch gekennzeichnet, dass das jeweilige Kompressionsverfahren in Abhängigkeit von mindestens einem Optimierungskriterium (13) durchgeführt wird. 5. The method according to any one of the preceding claims, characterized in that the respective compression method is carried out as a function of at least one optimization criterion (13).
6. Verfahren nach einem der vorangegangenen Ansprüche, dadurch gekennzeichnet, dass das Auswählen und/oder das Ausführen des jeweiligen Kompressionsverfahrens in Abhängigkeit von mindestens einer geographischen Information (15) und/oder mindestens einer Kontextinformation (16) erfolgt. 6. The method according to any one of the preceding claims, characterized in that the selection and / or execution of the respective compression method in Dependence on at least one piece of geographic information (15) and / or at least one piece of context information (16) takes place.
7. Verfahren nach einem der vorangegangenen Ansprüche, dadurch gekennzeichnet, dass das Komprimieren unter Berücksichtigung von erfassten Sensordaten (31) erfolgt. 7. The method according to any one of the preceding claims, characterized in that the compression takes place taking into account captured sensor data (31).
8. Verfahren nach einem der vorangegangenen Ansprüche, dadurch gekennzeichnet, dass das Neuronale Netz (10) eine Funktion für das automatisierte Fahren eines Fahrzeugs und/oder für eine Fahrerassistenz des Fahrzeugs und/oder für eine Umfelderfassung und/oder Umfeldwahrnehmung bereitstellt. 8. The method according to any one of the preceding claims, characterized in that the neural network (10) provides a function for automated driving of a vehicle and / or for driver assistance of the vehicle and / or for environment detection and / or environment perception.
9. Vorrichtung (1) zum Komprimieren eines Neuronalen Netzes (10), umfassend: eine Recheneinrichtung (2), wobei die Recheneinrichtung (2) dazu eingerichtet ist, ein trainiertes Neuronales Netz (10) zu erhalten, mindestens eine Strukturinformation des trainierten Neuronalen Netzes (10) zu extrahieren oder zu erhalten, das trainierte Neuronale Netz (10) zum Komprimieren in Abhängigkeit der mindestens einen Strukturinformation in Teilmengen (I, II, III, IV, V) zu unterteilen, und für jede Teilmenge (I, II, III, IV, V) jeweils ein Kompressionsverfahren in Abhängigkeit von mindestens einer Eigenschaft der jeweiligen Teilmenge (I, II, III, IV, V) zu wählen und zu verwenden, und das komprimierte Neuronale Netz (11) bereitzustellen. 9. Device (1) for compressing a neural network (10), comprising: a computing device (2), wherein the computing device (2) is set up to receive a trained neural network (10), at least one piece of structural information of the trained neural network (10) to extract or to obtain, to subdivide the trained neural network (10) for compression into subsets (I, II, III, IV, V) depending on the at least one structural information item, and for each subset (I, II, III , IV, V) to select and use a compression method depending on at least one property of the respective subset (I, II, III, IV, V) and to provide the compressed neural network (11).
10. Computerprogramm, umfassend Befehle, die bei der Ausführung des Computerprogramms durch einen Computer diesen veranlassen, die Verfahrensschritte des Verfahrens nach einem beliebigen der Ansprüche 1 bis 8 auszuführen oder Datenträgersignal, das ein solches Computerprogramm überträgt. 10. Computer program, comprising instructions which, when the computer program is executed by a computer, cause the computer to carry out the method steps of the method according to any one of claims 1 to 8 or a data carrier signal which such a computer program transmits.
EP21707207.3A 2020-03-04 2021-02-18 Method and apparatus for compressing a neural network Pending EP4115337A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
DE102020202795.1A DE102020202795A1 (en) 2020-03-04 2020-03-04 Method and device for compressing a neural network
PCT/EP2021/054084 WO2021175615A1 (en) 2020-03-04 2021-02-18 Method and apparatus for compressing a neural network

Publications (1)

Publication Number Publication Date
EP4115337A1 true EP4115337A1 (en) 2023-01-11

Family

ID=74673207

Family Applications (1)

Application Number Title Priority Date Filing Date
EP21707207.3A Pending EP4115337A1 (en) 2020-03-04 2021-02-18 Method and apparatus for compressing a neural network

Country Status (3)

Country Link
EP (1) EP4115337A1 (en)
DE (1) DE102020202795A1 (en)
WO (1) WO2021175615A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102022205679A1 (en) 2022-06-02 2023-12-07 Volkswagen Aktiengesellschaft Method, computer program and device for reducing the required computing power of an artificial intelligence algorithm, as well as means of transport

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11315018B2 (en) 2016-10-21 2022-04-26 Nvidia Corporation Systems and methods for pruning neural networks for resource efficient inference
US20180336468A1 (en) 2017-05-16 2018-11-22 Nec Laboratories America, Inc. Pruning filters for efficient convolutional neural networks for image recognition in surveillance applications

Also Published As

Publication number Publication date
WO2021175615A1 (en) 2021-09-10
DE102020202795A1 (en) 2021-09-09

Similar Documents

Publication Publication Date Title
DE102018116036A1 (en) Training a deep convolutional neural network for individual routes
DE102019124018A1 (en) Method for optimizing tests of control systems for automated vehicle dynamics systems
DE102021004561A1 (en) Text Refining Network
EP4115337A1 (en) Method and apparatus for compressing a neural network
DE102020207449B4 (en) Method, computer program and device for processing signals
DE102021200889A1 (en) Method for estimating a vehicle parameter for the operation of a vehicle
DE102017128082A1 (en) Meta-architecture design for a CNN network
DE102019213061A1 (en) Classification of AI modules
DE102021107247A1 (en) DOMAIN TRANSLATION NETWORK TO PERFORM AN IMAGE TRANSLATION
DE102019213459A1 (en) Method for compressing a neural network
DE102019219924B4 (en) Method and device for creating and providing a database with sensor data patches stored therein for use in quilting
DE102019219927A1 (en) Method and device for recognizing an alienation of a sensor data domain from a reference data domain
DE102019216184A1 (en) Method for the robustification of a neural network against adversarial disturbances
DE102019213458A1 (en) Method for compressing a neural network
DE102021104077B3 (en) Method, system and computer program product for the automated generation of traffic data
DE102021114044A1 (en) Method for providing an artificial neural network for three-dimensional object recognition, computing device for a vehicle, computer program and computer-readable (storage) medium
EP4128057A1 (en) Method and system for providing at least one compressed and specialized neural network for a vehicle
DE102020122408A1 (en) Method and device for compressing a neural network while maintaining robustness
DE102020201605A1 (en) Computer-implemented method and device for machine learning
DE102021214552A1 (en) Method for evaluating a trained deep neural network
DE102021115879A1 (en) Method for providing a compressed neural network
DE102019219926A1 (en) Method and device for training a neural network
DE102020208737A1 (en) Method and device for evaluating and certifying a robustness of an AI-based information processing system
DE102021206106A1 (en) Device and method for training a machine learning system to denoise an input signal
DE102022203834A1 (en) Method for training a machine learning algorithm taking into account at least one inequality condition

Legal Events

Date Code Title Description
STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: UNKNOWN

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: THE INTERNATIONAL PUBLICATION HAS BEEN MADE

PUAI Public reference made under article 153(3) epc to a published international application that has entered the european phase

Free format text: ORIGINAL CODE: 0009012

STAA Information on the status of an ep patent application or granted ep patent

Free format text: STATUS: REQUEST FOR EXAMINATION WAS MADE

17P Request for examination filed

Effective date: 20221004

AK Designated contracting states

Kind code of ref document: A1

Designated state(s): AL AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HR HU IE IS IT LI LT LU LV MC MK MT NL NO PL PT RO RS SE SI SK SM TR

DAV Request for validation of the european patent (deleted)
DAX Request for extension of the european patent (deleted)