METHOD FOR COMPRESSING A NEURAL NETWORK
Patent Information
- Application Number
- DE502020009441
- Authority / Receiving Office
- DE · DE
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2019-09-04
- Filing Date
- 2020-08-04
- Publication Date
- 2024-10-31
- Estimated Expiration
- 2040-08-04
AI Technical Summary
The increasing complexity and computational demands of convolutional neural networks (CNNs) in driver assistance systems for automated driving pose challenges due to limited computing capacity in vehicles, necessitating efficient methods to reduce the size of neural networks while minimizing impact on output quality.
A method where fleet participants locally execute neural networks, select elements to be pruned during inference phases, and transmit these selections to a central server for merging and pruning, allowing for a more comprehensive selection based on diverse situations and reducing the neural network's size efficiently.
This approach enables the compression of neural networks by selecting and removing elements with minimal impact on output quality, improving the computational efficiency and stability of automated driving systems.
Description
[0001] The invention relates to a method for compressing a neural network. Furthermore, the invention relates to a fleet participant, a central server, and a system.
[0002] Modern driver assistance systems and automated driving functions increasingly use machine learning to, among other things, recognize the vehicle's surroundings, including other road users (e.g., pedestrians and other vehicles), and describe their behavior. Input data from various sources (e.g., cameras, radar, lidar) is evaluated by deep neural networks, which, among other things, perform pixel-by-pixel classifications (semantic segmentation) or generate bounding boxes for detected objects.
[0003] In both cases, convolutional neural networks (CNNs) are typically used, which parameterize the weights of so-called filters during training based on the input. The convolutional networks used increasingly utilize a large number of filters and layers, resulting in an increasing time and computational effort for processing (inference) from input data to output. Since the application of neural networks in the field of automated driving is subject to severe constraints regarding the required computing time due to the dynamic environment, and at the same time, the hardware (computing capacity) available in vehicles cannot be scaled arbitrarily, the size of the neural network is a limiting factor with regard to its possible applications in such systems.
[0004] Pruning attempts to reduce the size of a neural network by removing individual elements—i.e., neurons, parameters, or entire filters. The choice of neurons or filters to be removed is crucial. Different filters can influence the network's output to varying degrees. Therefore, the goal is to use appropriate strategies to select those filters whose removal has the least impact on the output (quality), while simultaneously pruning as many filters as possible to significantly reduce the network size and thus minimize inference and training times.
[0005] Systems and methods for pruning a convolutional neural network (CNN) are known from US 2018 / 0336468 A1. The method comprises extracting convolutional layers from a trained CNN, each convolutional layer containing a kernel matrix with at least one filter trained in a corresponding output channel of the kernel matrix, and a feature map set with a feature map corresponding to each filter. For each kernel, an absolute kernel weight is determined and summed across each filter 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 prun the CNN. The CNN is retrained to generate a pruned CNN with fewer convolutional layers.
[0006] US 2018 / 0114114 A1 discloses a method, a computer-readable medium, and a system for pruning a neural network. The method comprises the steps of receiving first-order gradients of a cost function relative to layer parameters for a trained neural network and calculating a pruning criterion for each layer parameter based on the first-order gradient corresponding to the layer parameter, wherein the pruning criterion indicates an importance of each neuron included in the trained neural network and associated with the layer parameter. The method comprises the additional steps of identifying at least one neuron with the lowest importance and removing the at least one neuron from the trained neural network to generate a pruned neural network.
[0007] A method for distributed learning ("federated learning") is known from Jun Zhang et al., Mobile Edge Intelligence and Computing for the Internet of Vehicles, Proceedings of the IEEE, June 2, 2019, pages 246-261, DOI: 10.1109 / JPOC.2019.2947490, https: / / arxiv.org / pdf / 1906.00400.pdf.
[0008] From US 2019 / 0114543 A1, a local learning system in a local device for artificial intelligence (AI) is known. The local learning system comprises at least one data source, a data collector, a training data generator, and a local learning engine. The data collector is connected to the at least one data source and is used to collect training data. The training data generator is connected to the data collector and is used to analyze the training data to create example pairs for supervised learning or unlabeled data for unsupervised learning. The local learning engine is connected to the training data generator and contains a local
[0009] Neural network. The local neural network is trained using paired examples or unlabeled data in a training phase and inferred in an inference phase. Additionally, pruning of a neural network on the server is described.
[0010] WO 2018 / 218149 A1 discloses methods, systems, devices, and tangible, non-transitory computer-readable media for providing data, including vehicle map service data. The disclosed technology can perform operations including receiving vehicle map service data from client systems. The vehicle map service data can include information about a geographical area or sensor observations of a vehicle. Two or more pieces of vehicle map service data to which a client system has subscribed can be determined. Merged data based on the two or more pieces of vehicle map service data to which the client system has subscribed can be generated. Furthermore, the client system can be provided access to the merged data.Access to the merged data may include authorization to send or receive portions of the vehicle card service data associated with the merged data.
[0011] The invention is based on the object of improving a method for compressing a neural network, in particular with regard to a selection of elements of the neural network to be pruned.
[0012] The object is achieved according to the invention by a method having the features of patent claim 1, a fleet participant having the features of patent claim 9, a central server having the features of patent claim 10, and a system having the features of patent claim 11. Advantageous embodiments of the invention emerge from the subclaims.
[0013] In a first aspect of the invention, in particular, a method for compressing a neural network is provided, wherein fleet participants of a vehicle fleet locally execute the neural network and each determine a selection of elements of the neural network to be pruned during at least one inference phase, wherein the fleet participants transmit the respectively determined selection to a central server, wherein the central server combines the respectively transmitted selections and generates a combined selection, and wherein the central server prune the neural network on the basis of the combined selection.
[0014] In a second aspect of the invention, in particular, a fleet participant for a vehicle fleet is created, comprising a computing device, wherein the computing device is designed to locally execute a neural network and, during at least one inference phase, to determine a selection of elements of the neural network that are to be pruned and to transmit the determined selection to a central server.
[0015] In a third aspect of the invention, in particular, a central server is provided, comprising a computing device, wherein the computing device is designed to combine selections of elements of a neural network transmitted by fleet participants and to generate a combined selection, and to prune the neural network on the basis of the combined selection.
[0016] In a fourth aspect of the invention, a system is provided, comprising at least one fleet participant according to the second aspect of the invention and a central server according to the third aspect of the invention. The system, in particular, carries out the method according to the first aspect of the invention.
[0017] The method and system enable the efficient compression of a neural network. This is achieved by utilizing fleet members of a vehicle fleet. The fleet members execute the neural network using a computing device. During at least one inference phase, elements of the neural network are determined to be pruned. The determined elements are each transmitted to a central server in the form of a selection. The central server collects the respective selections of the fleet members and generates a consolidated selection from them. The neural network is then pruned, in particular by means of the central server, based on the consolidated selection.
[0018] An advantage of the invention is that the selection of elements to be pruned is based on an expanded database, since a large number of fleet members select elements of the neural network, taking into account different situations. The more fleet members are considered when determining the selection of the neural network elements to be pruned, the more situations can be considered. This improves the selection of the elements to be pruned.
[0019] The computing devices of the fleet participants each have, in particular, a memory device or can each access such a memory device. The computing devices can be designed as a combination of hardware and software, for example as program code executed on a microcontroller or microprocessor. The computing devices operate, in particular, the neural network, i.e., the computing devices perform the computing operations necessary to operate the neural network on provided input data, so that activations or values at the outputs of the neural network can be inferred and provided in the form of output data. For this purpose, local copies of the neural network are stored in the respective associated memory devices, i.e., a structure and associated weightings as well as parameters of the neural network.
[0020] The central server's computing device is configured accordingly. A central copy of the neural network is located in the central server's memory. Pruning is performed on the central copy of the neural network.
[0021] Input data is, in particular, sensor data, in particular a sensor data stream of sensor data acquired over time. In particular, the sensor data is acquired by sensors and fed to an input layer of the neural network, for example, via a dedicated input interface. A sensor is, in particular, a camera, a lidar, or a radar sensor. However, fused sensor data can also be used in principle.
[0022] A fleet member is, in particular, a motor vehicle. However, in principle, a fleet member can also be any other land, water, air, or space vehicle.
[0023] The transmission of selections from the fleet participants to the central server takes place primarily via dedicated communication interfaces between the fleet participants and the central server. Communication is primarily wireless.
[0024] The neural network is, in particular, a deep neural network, specifically a convolutional neural network (CNN). Specifically, the neural network is designed to perform a perception function. For example, the neural network can be used to classify objects based on acquired sensor data, such as camera data. Furthermore, it can also identify areas of the sensor data where objects can be found (bounding box).
[0025] An element is, in particular, a neuron of the neural network. If the neural network is a convolutional network, an element is, in particular, a filter of the convolutional network.
[0026] Pruning a neural network specifically means changing its structure, specifically pruning or reducing its size. This is done by removing elements and / or parts of the elements (e.g., parameters or input channels, etc.) from the neural network. Due to the changed, especially pruned, structure, the pruned neural network can be applied to input data with less computing power. The pruned neural network is then compressed in its structure.
[0027] In particular, it can be provided that the method is repeated cyclically. For example, the method can be repeated until a termination criterion is met. The termination criterion can, for example, be a failure to meet a functional quality of the (progressively) pruned neural network.
[0028] In particular, it may be provided that the pruning is followed by retraining of the pruned neural network in order to restore the functional quality (performance) of the (pruned) neural network after the pruning.
[0029] Pruning is specifically designed to ensure that the neural network is pruned homogeneously. "Homogeneous" means that, on average, all areas of the neural network are pruned equally. This prevents excessive pruning of certain areas or individual layers of the neural network, which could adversely affect the functionality or functional quality of the neural network.
[0030] The elements of the neural network can be selected in various ways. In a simple embodiment, for example, those elements of the neural network that have the least influence on the output result of the neural network are selected for pruning by the fleet participants. It can also be provided that elements are selected whose output activations are always below a predetermined threshold.
[0031] The selected elements are collected, for example, in the form of a list, a table, or a database and compiled for selection. The list, table, or database contains, for example, a unique identifier for each selected element and, if applicable, further properties or values, such as a maximum, minimum, and / or average activation of the element under consideration. In particular, the list, table, or database includes a selection criterion used or a value of the respective element associated with the selection criterion used. The selection criterion defines the conditions under which the elements are selected. The list, table, or database is transmitted, in particular, in the form of a digital data packet to the central server via the communication interfaces.
[0032] The lists / rankings / tables can be combined in various ways. In particular, averages can be calculated and / or other averaging methods can be used, such as arithmetic averages, geometric averages, moment-based averaging methods, swarm-based averaging methods, geographical averaging methods based on the distance traveled by the fleet member(s), and / or safety-focused or situation-dependent averaging methods.
[0033] In particular, the merging may include determining the items most frequently selected by the fleet participants, wherein the merged selection includes the most frequently selected items.
[0034] It can be provided that the pruned neural network is output after pruning, for example in the form of a digital data set describing the structure and the weightings or parameters of the neural network.
[0035] It can be specified that only selected fleet members of the vehicle fleet execute the process. Other fleet members, however, can only use the neural network and, for example, receive the pruned neural network from the central server after pruning the neural network. However, the other fleet members do not select or transmit the elements to be pruned. This has the advantage that the selected fleet members can be technically better equipped to carry out the process, for example, with regard to sensor technology and / or the storage capacity of a storage device.
[0036] It is intended that the pruned neural network is then transmitted to at least one fleet participant. This occurs, for example, in the form of a digital data packet transmitted via the communication interfaces, which contains the structure, weights, and parameters of the pruned neural network. The fleet participants receive the pruned neural network and then replace the neural network stored in a respective storage device with the received pruned neural network. The method can then be executed again on the pruned neural network.
[0037] In one embodiment, the selection is transmitted to the central server if at least one transmission criterion is met. This can avoid unnecessary communication between the fleet participants and the central server. A transmission criterion can, for example, be a certain number of locally collected neural network elements. A transmission criterion can also require that a selection no longer changes after multiple runs or inference phases.
[0038] In one embodiment, the fleet members each create a ranking of the selected elements, and the selection is transmitted to the central server in the form of the created ranking. The central server creates a consolidated ranking based on the transmitted rankings for merging purposes, and the neural network is pruned based on the consolidated ranking. This allows for the targeted pruning of those elements that achieve the highest values according to a criterion used to create the ranking.
[0039] In one embodiment, temporally changing input data is fed to the neural network to determine the respective selection, wherein temporal activation differences of elements of the neural network are determined for temporally adjacent input data, and wherein the elements of the neural network are selected depending on the determined temporal activation differences. This makes it possible to compress the neural network while taking a stability-oriented criterion into account. This is achieved by feeding the neural network temporally changing input data. As the input data changes over time, the activations or values at the respective outputs of the individual elements of the neural network also change. A temporal change in the activations or values at the outputs is then mapped via temporal activation differences of the elements of the neural network.The implementation is based on the following consideration: Since the input data, which is provided in particular based on acquired sensor data, generally varies only slightly with a small change in time, the activation differences determined for this temporal change at the outputs of the elements should also vary only slightly. Large activation differences therefore indicate unstable elements in the neural network. By determining the temporal activation differences, the unstable elements can be identified. Once the unstable elements have been identified, they can later be removed from the neural network structure centrally on the central server by means of pruning.
[0040] An activation difference is, in particular, a difference determined from activations or values of an output that are inferred or calculated by an element of the neural network at adjacent, especially consecutive, points in time. For example, if the input data is camera data, the input data can correspond to two consecutive individual images of the camera data. The activation difference therefore represents a temporal fluctuation of the activations at the output of an element of the neural network depending on the temporally varying input data.
[0041] The input data is, in particular, sensor data, in particular a sensor data stream of sensor data acquired over time. In particular, the sensor data is acquired by sensors and fed to an input layer of the neural network, for example, via a dedicated input interface.
[0042] If the neural network is a convolutional network, the activation differences are determined for each filter of the convolutional network.
[0043] If the procedure is repeated cyclically, the repetition of the procedure can be stopped, for example, if the activation differences are below a predetermined threshold, i.e. when a predetermined degree of stability is reached.
[0044] In particular, it is intended that element-by-element averages are calculated from the determined activation differences, with pruning being performed depending on the calculated averages. This allows short-term peaks in the activation differences to be taken into account or mitigated. Such peaks alone do not lead to the corresponding element of the neural network being identified as unstable. Only when an average determined for this element from several activation differences exceeds a threshold, for example, is the corresponding element selected for pruning. The averages can be determined as an arithmetic mean, a time mean, or a geometric mean. The calculation of averages can be performed either by the fleet participants or by the central server.
[0045] The merging of the selections in the central server, which can also be referred to as aggregation, can in particular include the formation of an arithmetic mean, geometric averaging methods (e.g., centroids of vectors formed from individual rankings can be formed), moment-based averaging methods, swarm-based averaging methods, geographical averaging methods and / or security-focused averaging methods.
[0046] Swarm-based averaging methods can be designed, in particular, as partial filters, meaning that subsets are selected from the selections of the individual fleet participants, and averaging is performed only within these subsets. The subsets can be formed, for example, based on a geographical location or region, a route, a point in time (time of day, day of the week, month, season, etc.), or other characteristics. The subsets are always formed based on commonalities among the fleet participants providing the selections or the circumstances under which the selections were created.
[0047] Safety-focused averaging methods specifically consider a situation in which an element of the neural network has been selected for pruning. This situation can then influence the determined rankings. For example, safety-critical situations (e.g., when small children are in the vicinity of a motor vehicle) can lead to selected elements being shifted further up the ranking, i.e., toward higher ranks. In particular, if a temporal activation difference is used to select the elements, this can increase (or decrease) the "penalty" of an element or a filter, so that situation-specific circumstances influence the ranking.
[0048] In one embodiment, at least some of the determined activation differences are determined as a function of at least one influencing parameter. This can, for example, ensure that the activation differences can be influenced over time or depending on the situation. For example, a speed (provided, for example, by a GPS sensor), current weather (provided, for example, by a rain sensor), and / or a steering angle (provided, for example, by a steering angle sensor) can be used to amplify or attenuate a specific activation difference depending on the situation. In particular, situation-dependent sensor properties can be taken into account in this way.
[0049] In one embodiment, it is provided that the ranking of the elements is created based on the determined temporal activation differences, with pruning being carried out depending on the created ranking. In particular, the ranking is created based on the respective mean values of the determined activation differences. Based on the created ranking, it can be provided, for example, that a predetermined number of ranks are later taken into account during pruning in the central server, for example the 10, 100, or 1000 elements of the neural network (e.g. the 10, 100, or 1000 filters of the convolutional network) that have the largest (averaged) activation differences. Creating the ranking makes it possible to compress the neural network and, in doing so, to specifically select and prun the most unstable elements.The rankings created by the fleet participants and transmitted to the central server as their respective selections are combined by the central server into a consolidated ranking.
[0050] In a further embodiment, it is particularly provided that the ranking is determined in such a way that the elements of the neural network with the largest temporal activation differences are pruned. This removes the most unstable elements of the neural network from the neural network.
[0051] A ranking function for determining an (in)stability of an element of the neural network can, in a simple case, be defined by a temporal activation difference between activations of the element with respect to a (temporal) change in the input data (e.g., a change in temporally adjacent video frames).
[0052] If the input data are individual video frames, for example camera images from an environment camera, the Structural Similarity Index (SSIM) between the individual video frames from different points in time can be used in a ranking function to determine a difference between temporally adjacent video frames.
[0053] For a convolutional neural network (CNN), the ranking function for a considered filter (also known as the filter kernel) in a convolutional layer of the CNN is further developed, additionally taking into account the temporal activation differences in a preceding convolutional layer of the neural network. This allows the influence of a preceding convolutional layer to be taken into account or eliminated when determining or calculating the temporal activation differences. The idea behind this is that activation differences can propagate through the neural network, as the temporal activation differences of one convolutional layer are passed on to the subsequent convolutional layer. By taking into account the temporal activation differences of the respective preceding convolutional layer, the activation differences calculated for individual filters are made comparable across the entire neural network or across layers.This makes it easier to determine the ranking of the elements of the neural network.
[0054] In a further development, it may be provided that the average is calculated over several time steps. Furthermore, it may be provided that the average is calculated over several sets of input data, for example, several video sequences each consisting of individual video images.
[0055] In a further embodiment, it is provided that the combined ranking is created taking into account at least one target variable. This makes it possible to generate an extended ranking. In particular, by taking into account the at least one target variable, further objectives can be taken into account in addition to the stability of the neural network. These objectives can, for example, relate to the robustness of the neural network. If the neural network is used, for example, to recognize objects in camera data, robustness to changes in brightness can be aimed for as a target variable. When selecting the temporal variance across the input data, care is taken to ensure that this temporal variance only manifests itself as a variance of the at least one target variable. The ranking is then compiled in a similar manner.Furthermore, filters that have a greater influence within the neural network can be retained despite a large activation difference. Filters that are functionally similar to other filters (e.g. filters that filter camera data by convolution with a filter function) can be moved higher in the ranking, meaning they are given priority during pruning or removal. On the other hand, filters that are not similar to other filters can be moved lower in the ranking, meaning they are pruned less preferentially. Other target variables can be plurality-oriented, meaning they ensure that many different features are detected or filtered out in the input data. Accordingly, a certain ranking is adjusted so that many different features or a minimum number of different features can still be detected or filtered out.Another target variable can also be the performance of the neural network. Simply put, the combined ranking can be determined and / or adjusted in such a way that all intended target variables are taken into account when selecting the neural network elements or filters to be pruned.
[0056] In one embodiment, the determination of the selections, in particular via the activation differences, and the pruning are limited to selected layers of the neural network. This allows layers that serve, for example, for feature extraction to be excluded from pruning. Especially for neural networks that perform various tasks (multi-task learning) or whose task fulfillment is broken down into different sub-steps, pruning can be concentrated on specific subtasks. One example of this is region proposal networks, which first identify image sections relevant for object recognition and then classify and evaluate them. In this case, it can be expedient to concentrate pruning on classification in order to prevent relevant image areas from being overlooked due to pruning.
[0057] In one embodiment, the neural network is retrained after pruning. This can improve the functional quality of the pruned or compressed neural network. This does not require a complete training run. Instead, it can be provided that the pruned or compressed neural network is retrained using only a portion of the training data originally used for training. Retraining is performed, in particular, via the central server.
[0058] In one embodiment, the elements are deactivated for pruning, at least initially. For this purpose, parameters of the element to be pruned are set to zero, for example, so that the element in the neural network no longer influences a result in the subsequent layer or the output layer of the neural network. This has the advantage that deactivation can be reversed more easily than removing an element of the neural network. If, for example, it turns out after deactivating an element that the functional quality of the neural network is too severely impaired, the element can be reactivated. In particular, the reactivated element can then be marked so that it is not deactivated and / or pruned again in subsequent runs of the method.Otherwise, the deactivated element can be removed in a later step, meaning a structure of the neural network is adjusted. This occurs especially if a functional quality or other target values are achieved despite the deactivated element.
[0059] In one embodiment, pruning only occurs when at least one trigger criterion is met. This allows pruning to occur whenever a specific state is reached. In particular, constant or excessively frequent pruning and / or an excessively varied selection of the elements of the neural network to be pruned can be prevented in this way. The trigger criterion can, for example, be a predetermined number of elements in the ranking. Furthermore, the trigger criterion can additionally or alternatively also be a convergence of the ranking. Convergence of the ranking here means that the elements in the determined ranking no longer change over a predetermined number of runs of the method or a predetermined period of time, at least for a predetermined number of ranks. The presence of the trigger criterion is checked in particular by means of the central server.
[0060] In one embodiment, the determination of the ranking is designed as an iterative process. Following the transmission and merging (or aggregation step) on the central server, the ranking is distributed again, for example, as a table, to the fleet members of the vehicle fleet. The fleet members then continue or update the ranking until a relevant deviation from the last distributed ranking occurs and the next aggregation step is triggered. This process ends when the ranking changes only marginally or remains unchanged.
[0061] Further features regarding the design of the fleet participant, the central server, and the system are described in the description of the process configurations. The advantages of the fleet participant, the central server, and the system are the same as in the process configurations.
[0062] The invention is defined by the claims.
[0063] The invention will be explained in more detail below using preferred embodiments with reference to the figures. Fig. 1 is a schematic representation of an embodiment of the system; Fig. 2 is a schematic flow diagram of an embodiment of the method for compressing a neural network.
[0064] In Fig. 1 A schematic representation of an embodiment of the system 1 is shown. The system 1 comprises several fleet participants 2 in the form of motor vehicles 50 and a central server 20.
[0065] Each fleet member 2 comprises a computing device 3, a storage device 4, and a communications interface 5. Furthermore, each fleet member 2 comprises a sensor system 6, for example in the form of a camera 51, which provides camera data as input data 7 via an input interface 8, which is fed from the input interface 8 to the computing device 3. A neural network 9 is stored in each memory device 4, i.e., a structure, weightings, and parameters that uniquely describe the neural network 9. The computing device 3 can execute computing operations in the memory device 4 and, in particular, operates the neural network 9.
[0066] The central server 20 comprises a computing device 21, a storage device 22 and a communication interface 23.
[0067] The computing device 3 of the fleet participants 2 is configured to locally execute the neural network 9 stored in the memory device 4 on the input data 7 and, during at least one inference phase, to determine a selection 10 of elements of the neural network 9 to be pruned. Once the selection 10 has been made, the computing device 3 transmits the determined selection 10 to a central server 20 via the communication interface 5.
[0068] The computing device 21 of the central server 20 is configured to receive selections 10 of elements of the neural network 9 transmitted by the fleet participants 2 via the communication interfaces 5, 23, combine them, and generate a combined selection 11. The neural network 9 is then pruned by the computing device 21 based on the combined selection 11, thereby generating a pruned neural network 12.
[0069] It can be provided that the pruned neural network 12 is subsequently transmitted to the fleet participants 2 via the communication interfaces 5, 23. The computing devices 3 of the fleet participants 2 can then replace the neural network 9 in the storage device 4 with the pruned neural network 12.
[0070] It can be provided that the selections 10 are transmitted to the central server 20 if at least one transmission criterion 13 is met. The transmission criterion 13 can, for example, be a specific number of locally collected or selected elements of the neural network 9. A transmission criterion 13 can also be that a selection no longer changes after several local runs or inference phases.
[0071] It can be provided that the fleet participants 2 each create a ranking 14 of the selected elements, and the selection 10 is transmitted in the form of the created ranking 14 to the central server 20, wherein the central server 20 creates a consolidated ranking 15 based on the transmitted rankings 14 for merging. The pruning of the neural network 9 is then carried out based on the consolidated ranking 15.
[0072] It can be provided that temporally changing input data 7 are fed to the neural network 9 to determine the respective selection 10, wherein temporal activation differences of elements of the neural network 9 are determined for temporally adjacent input data 7, and wherein the selection of the elements of the neural network 9 takes place depending on the determined temporal activation differences. In particular, it can be provided that, for the selection, a ranking 14 of the elements of the neural network 9 is created based on the temporal activation differences determined for each of the elements. The selection 10 then comprises the ranking 14 thus created.
[0073] It may be provided that the neural network 9 is retrained in the central server 2 after pruning.
[0074] It can be provided that the elements are deactivated for pruning, at least initially. For this purpose, parameters of the element are set to zero, for example, so that the element in the neural network 9 no longer has any influence on a result in the subsequent layer or the output layer of the neural network 9. If, for example, it turns out after deactivating an element that the functional quality of the neural network 9 is too severely impaired, the element can be reactivated. In particular, the reactivated element can then be marked so that it is not deactivated and / or pruned again in subsequent runs of the method. In a later step, in particular after retraining the neural network 9, the deactivated element can be removed, i.e. a structure of the neural network 9 is adapted so that the pruned neural network 12 is generated.This occurs in particular if a functional quality or other target values are achieved despite the deactivated element.
[0075] Furthermore, it can be provided that pruning only occurs when at least one trigger criterion 30 is met. The trigger criterion 30 can, for example, be reaching a predetermined number of elements in the merged ranking 15. Furthermore, the trigger criterion 30 can additionally or alternatively also be a convergence of the merged ranking 15. Convergence of the merged ranking 15 here means that the elements in the merged ranking 15 no longer change over a predetermined number of runs of the method or a predetermined period of time, at least for a predetermined number of ranks. The presence of the trigger criterion 30 is checked in particular by means of the central server 20.
[0076] In Fig. 2A schematic flow diagram is shown to illustrate an embodiment of the method for compressing a neural network 9. The method is carried out by means of a system 1, which, for example, as shown in the Fig. 1 shown embodiment. One part of the method is executed in each fleet member 2, another part in the central server 20. The flowchart is explained using the example of input data 7, which is provided in the form of a video 40 consisting of individual video images 41 (frames). The individual video images 41 each correspond to a time ti.
[0077] In a method step 100, the individual video images 41 are fed to the neural network 9. This is shown for two adjacent time steps, i.e., for an individual video image 41 corresponding to time t i and for an individual video image 41 corresponding to the subsequent time t i+1 . The neural network 9 is applied to the individual video images 41 and infers a result at the outputs of an output layer of the neural network 9. The result can include, for example, object detection or classification and / or the creation of bounding boxes for the detected objects. During inference, values for activations 43 of elements of the neural network 9 are recorded or read out. If the neural network 9 is designed as a convolutional network, the activations 43 correspond to the respective values at the outputs of filters of the convolutional network.The result is provided, for example, as a list in which the corresponding activation 43 for each element of the neural network 9 is stored for the considered times ti and t i+1.
[0078] In a method step 101, a temporal activation difference 44 for the two considered times ti and t i+1 is determined from the values for the activations 43 of the individual elements. This is done element by element for all elements of the neural network 9. In particular, an amount of a difference between the activation values 43 of the individual elements is considered. For each of the elements of the neural network 9, a temporal activation difference 44 with respect to the two times ti and t i+1 is then available. The result is provided, for example, as a list in which the temporal activation difference 44 for the considered times ti and t i+1 is stored for each element of the neural network 9.
[0079] It can be provided that the temporal activation differences 44 are averaged and the subsequent method steps 102-106 are carried out based on the averaged activation differences 44.
[0080] It can be provided that at least some of the determined temporal activation differences 44 are determined as a function of at least one influencing parameter 45. For example, a speed (provided, for example, via a GPS sensor), current weather (provided, for example, via a rain sensor), and / or a steering angle (provided, for example, via a steering angle sensor) can be used to amplify or attenuate a specific temporal activation difference 44 depending on the situation.
[0081] In a method step 102, the determined temporal activation differences 44 are sorted by size. This results in a ranking 14 in which the elements of the neural network 9 with the largest temporal activation differences 44 occupy the upper ranks.
[0082] In a method step 103, the created rankings 14 are transmitted by the fleet participants 2 to the central server 20 via communication interfaces.
[0083] In the central server 20, in a method step 104, a summarized ranking 15 is generated based on the transmitted rankings 14. The merging, which can also be referred to as aggregation, can include, in particular, the formation of an arithmetic mean, geometric averaging methods (e.g., centroids of vectors formed from the individual rankings 14 can be formed), moment-based averaging methods, swarm-based averaging methods, geographical averaging methods, and / or security-focused averaging methods.
[0084] It can be provided that the combined ranking 15 is created taking into account at least one target variable 46. The at least one target variable 46 can, for example, relate to the robustness of the neural network 9. Furthermore, elements or filters that have a greater influence within the neural network 9 can be retained despite a large temporal activation difference 44. Elements or filters that are functionally similar to other elements or filters (e.g., filters that filter camera data by convolution with a filter function) can also be moved forward in the combined ranking 15, i.e., given priority during pruning or removal. In contrast, elements or filters that are not similar to other elements or filters can be moved back in the combined ranking 15, i.e., deleted with less preference.Additional target variables 46 can be plurality-oriented, meaning they ensure that many different features are detected or filtered out in the input data 7. Accordingly, a composite ranking 15 is adjusted so that many different features or a minimum number of different features are still detected or filtered out. Another target variable 46 can also be the performance of the neural network 9.
[0085] It may be provided that the elements for pruning are deactivated, at least initially. In a subsequent process step, for example, after successful retraining, the neural network 9 can then be pruned.
[0086] In a method step 105, the neural network 9 is pruned by removing elements of the neural network 9 with the largest temporal activation differences 44 from the structure of the neural network 9 according to the composite ranking 15. As a result, a pruned neural network 12 is provided.
[0087] It can be provided that in a method step 200, a check is carried out beforehand to determine whether at least one trigger criterion 30 is met. Only when the trigger criterion 30 is met is the pruning of the neural network 9 carried out.
[0088] In a method step 106, in order to increase a functional quality of the pruned neural network 12, it can be provided that the pruned neural network 12 is retrained.
[0089] The described method steps 100-106 are performed for further time points t i+x. In particular, it is provided that the pruning in method step 105 is performed based on a combined ranking 15 created for mean values of the temporal activation differences 44. In particular, averaging is performed over several time points t i.
[0090] In particular, it is provided that method steps 100-106 are repeated cyclically, using current input data 7 in each case. In particular, it is provided that method steps 100-106 are repeated using the (retrained) pruned neural network 12, wherein the neural network 9 is replaced for this purpose with the (retrained) pruned neural network 12 in each case.
[0091] By means of the described embodiment of the method, the neural network 9 can be compressed, while at the same time the stability of the neural network 9 is increased, since unstable elements of the neural network 9 are removed or deactivated.
[0092] The following illustrates the determination of a ranking based on temporal activation differences using a mathematical example. It is assumed that the input data consists of a video sequence of individual video frames. Depending on the number of individual video frames per unit of time (e.g., frames per second), only minor changes occur in neighboring video frames. The method takes advantage of this and uses it for stability-based pruning of the neural network. The method is applied in particular to a well-trained neural network, in particular a convolutional neural network (CNN). The CNN filters are considered as elements of the neural network.Here, filters (also referred to as filter kernels) whose activations exhibit a large change in activation (i.e., where the temporal activation difference is large) for adjacent video frames, i.e., for temporally changing input data, are considered unstable. In the embodiment of the method, such filters are ranked higher. Only unmarked (unlabeled) input data is required as input data, for example, individual video frames of a video sequence captured with a camera to capture the surroundings of a motor vehicle.
[0093] A (convolutional) layer comprises in particular several filters (also referred to as filter kernels), whereby each filter receives in particular an entire output of a previous layer and each filter provides an associated feature map as output.
[0094] For a single video frame in a sequential data set (video sequence) with a height H, a width W , channels C and a point in time t, with t ∈ ℕ : 1 … T , becomes xt ∈ GH×W×C< as a single video frame of a data set x defined, where G = 0 ≤ z ≤ 255 | z ∈ ℕ . The video frame xt is the input (i.e. corresponds to the input data at the input) of a neural network (·, i ), where i Parameters of the neural network are. This neural network (·, i ) includes L ∈ ℕ (Convolutional) layers whose outputs Ψ l ⋅ ∈ ℝ H l × W l × k l are, with a height H l , a width W l and a number of feature cards k l for l e {1, ..., L} .
[0095] With Ψ l,j the j-th feature map of the output of the layer l, that is, the feature map corresponding to filter j of layer I, where j e {1, ..., k l }. As a set of all feature maps in the neural network at a time t can then = {Ψ l,j } ∀ l = {1, ..., L}, j = {1, ..., k l } must be defined.
[0096] In particular, stability is defined as a change in the output Ψ l,j (activation difference) with respect to a change in the associated input xt , that is, for a filter j in the shift l and a time t a ranking function rank : rank l j t = ∂ Ψ l , j x t ∂ x t with ⋅ : ℝ H l × W l → ℝ ≥ 0
[0097] Simply put, the larger the resulting value of the ranking function for a given filter, the greater the instability. Specifically, the ranking function is determined for each element of the neural network—in the current example, for each filter.
[0098] The changes in the editions Ψ l,j ( xt ), that is, in the activation of the filters, can have two causes. Firstly, a change in the output can be caused by a change in the video frame xt at the input. Secondly, a change can also be caused by a change in the activations at the output of a preceding layer ψ l -1 ( xt ) can be caused.
[0099] To calculate the difference between consecutive video frames (i.e., temporally adjacent input data), the well-known Structural Similarity Index (SSIM) can be used. SSIM is used to measure the similarity between two images. Δ x t = 1 − SSIM x t x t − 1
[0100] Since the stability of Ψ l,j also from a stability of the outputs (activations) of ψ l -1, it should be prevented that a filter in the layer l due to instability in the layer l - 1. Therefore, the contribution of the preceding layer is taken into account in the ranking function. is the normalized output of the I-th layer to the subsequent layer at time t. This is calculated in the following equation. In order to compare the changes in the outputs (activations) of the filters in the entire neural network, the outputs (activations) are normalized with a height H l , a width W l and a number k l of channels (feature maps) of the layer l . D l , t = ψ l x t − ψ l x t − 1 H l × W l × k l
[0101] To calculate the stability-based rank of each filter, equations (2) and (3) are combined with equation (1). The rank is defined as R l , j a , where a ∈ ℕ : 1 , … , A is a video sequence. Equation (4) defines the rank as a (temporal) activation difference averaged over all time points t (i.e., over a number T of video frames) with respect to a change at the inputs of the filters, i.e., with respect to a (temporal) change in the input data: R l , j a = ∑ t = 1 T 1 T Ψ l , j x t − Ψ l , j x t − 1 Δ x t + λ D l − 1 , t × H l × W l
[0102] l is a weighting factor with which the influence of the preceding layer can be adjusted. Here, the influence of the preceding layer is calculated with a value H l × W l the respective layer under consideration l weighted.
[0103] From this, mean values are determined, i.e. the rank R l , j a is summarized over several unlabeled video sequences A and (arithmetically) averaged, as shown in equation (5). R l , j = 1 A ∑ a = 1 A R l , j a
[0104] Larger values of R l,jeach indicate greater instability of the filter under consideration (the j-th filter in the i-th layer). It is possible to use other methods for averaging, e.g., moment-based averaging methods or averaging methods in which individual activation differences are each weighted.
[0105] The ranking created in this way is transmitted to the central server, where the transmitted ranking is merged with the transmitted rankings of other fleet participants.
[0106] The neural network is then prune based on the merged ranking, for example, the filters in the upper ranks (5, 10, 20,... etc.) of the merged ranking are removed from the neural network because these are the most unstable filters or elements of the neural network.
[0107] The mathematical example refers to a video sequence or individual video frames as input data. However, the procedure is essentially analogous for other types of input data. Reference symbol list
[0108] 1System 2Fleet participants 3Computing device (fleet participant) 4Storage device (fleet participant) 5Communication interface (fleet participant) 6Sensors 7Input data 8Input interface 9Neural network 10Selection 11Aggregated selection 12Pruned neural network 13Transmission criterion 14Ranking 15Aggregated ranking 20Central server 21Computing device (central server) 22Storage device (central server) 23Communication interface (central server) 30Triggering criterion 40Video 41Video frame 43Activation 44Temporal activation difference 45Influencing parameter 46Target variable 50Motor vehicle 100-106Procedure steps 200Procedure step ti Time t i+1 Time t i+x Further time
Claims
1. Method for compressing a neural network (9), wherein fleet members (2) of a vehicle fleet execute the neural network (9) locally, and in each case determine, during at least one inference phase, a selection (10) of elements of the neural network (9) that are intended to be pruned, wherein the fleet members (2) transmit the selection (10) determined in each case to a central server (20), wherein the central server (20) merges the selections (10) determined in each case and generates a merged selection (11), and wherein the central server (20) prunes the neural network (9) on the basis of the merged selection (11), wherein the pruned neural network (9) is subsequently transmitted to at least one fleet member (2), wherein the at least one fleet member (2) receives the pruned neural network (9) from the central server (20) and replaces the neural network (9) stored locally in a storage device with the received pruned neural network (9).
2. Method according to claim 1, wherein the selection (10) is transmitted to the central server (20) if at least one transmission criterion (13) is met.
3. Method according to either of the preceding claims, wherein the fleet members (2) each create a ranking (14) of the selected elements and the selection (10) is transmitted to the central server (20) in the form of the created ranking (14), wherein the central server (20) creates a merged ranking (15) on the basis of the transmitted rankings (14) for merging, and wherein the neural network (9) is pruned on the basis of the merged ranking (15).
4. Method according to any of the preceding claims, wherein temporally changing input data (7) are fed to the neural network (9) for determining the relevant selection (10), wherein temporal activation differences (44) of elements of the neural network (9) are determined for temporally adjacent input data (7), and wherein the elements of the neural network (9) are selected depending on the determined temporal activation differences (44).
5. Method according to any of the preceding claims, wherein the neural network (9) is retrained following pruning.
6. Method according to any of the preceding claims, wherein the elements are at least initially deactivated for pruning.
7. Method according to any of the preceding claims, wherein pruning only takes place if at least one trigger criterion (30) is met.
8. Fleet member (2) for a vehicle fleet, comprising: a computing device (3), wherein the computing device (3) is designed in such a way as to execute a neural network (9) locally, and in each case determine, during at least one inference phase, a selection (10) of elements of the neural network (9) that are intended to be pruned, and to transmit the determined selection (10) to a central server (20), and also to receive a pruned neural network (9) from the central server (20) and to replace the neural network (9) stored locally in a storage device with the received pruned neural network (9).
9. Central server (20), comprising: a computing device (3), wherein the computing device (3) is designed in such a way as to merge selections (10) of elements of a neural network (9) in each case transmitted by fleet members (2) and to generate a merged selection (11), and to prune the neural network (9) on the basis of the merged selection (11), and to subsequently transmit the pruned neural network (9) to at least one fleet member (2).
10. System (1) comprising: at least one fleet member (2) according to claim 8 and a central server (20) according to claim 9.
