Computing efficient convolutional neural networks

By using locally sensitive hashing techniques in convolutional neural networks to cluster and merge redundant channels, the problems of high computational cost and complex model training in the prior art are solved, and efficient computational cost reduction and model performance maintenance are achieved.

CN119692398APending Publication Date: 2025-03-25ROBERT BOSCH GMBH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411325377.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-09-22
Filing Date
2024-09-23
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

Prior art often requires retraining or fine-tuning the model when reducing the computational cost of convolutional neural networks (CNNs), resulting in increased energy and time consumption and can lead to catastrophic forgetting.

Method used

Using a locally sensitive hash (LSH)-based method, the number of channels in each part of the convolution layer tensor is dynamically reduced, redundant channels are clustered through the hash function, and similar channels are merged to reduce the computational cost of convolution operations.

Benefits of technology

A plug-and-play alternative with no parameters and data is realized, which directly reduces the FLOP computing cost in the CNN architecture, avoids retraining and fine-tuning steps, and improves computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119692398A_ABST
    Figure CN119692398A_ABST
Patent Text Reader

Abstract

A computer-implemented method of efficiently computing a convolution operation comprises the steps of receiving a tensor # imgabs0 # and at least one filter # imgabs1 # # imgabs2 # of input data and initializing a locality sensitive hash function. The following steps are then repeated for the plurality of patches in the tensor: cutting the current acceptance domain into a series of (cin) matrices (k + b * k + b). Local sensitive hashing is applied to each of the matrices to determine a hash representation for each of the matrices. The matrices with substantially the same hash representation are merged into a new matrix. A simplified tensor (cin, reduced k + b * k + b) is created by arranging the merged matrices in order. The filter coefficients are merged in the same order as merging the matrix and the simplified sub-tensor is convolved with the merged filter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for efficiently computing convolution via locality sensitive hashing, as well as a computer program, a machine-readable storage medium and a training system. Background Art

[0002] Reducing the computational cost of convolutional neural network architectures (CNNs) in order to apply them in autonomous driving scenarios as image classifiers or semantic segmentation backbones is important for achieving high computational performance.

[0003] In order to reduce the computational cost, the Dynamic Dual Gating Neural Networks method by Fanrong Li et al. is known from the literature (available online at: https: / / openaccess.thecvf.com / content / ICCV2021 / papers / Li_Dynamic_Du al_Gating_Neural_Networks_ICCV_2021_paper.pdf). The authors use a trainable method to find redundancy in the spatial and channel dimensions of the convolutional modules during the training of the underlying CNN. After the training process, their method can be used to dynamically reduce the computational cost that depends on the input image. This is achieved by generating spatial and channel masks from additional parameters of the training, effectively hiding redundant information in the convolution operation, thereby reducing the (theoretical) computational cost.

[0004] Other methods, such as Pruning Filters for Efficient Convolutional Networks by HaoLi et al. (available online at https: / / arxiv.org / pdf / 1608.08710.pdf), prune the filters of the CNN. This can happen after training by taking some metric (such as the L2 norm of the filter) to determine whether the filter / channel can be pruned safely, i.e. without causing too much damage to the accuracy / model performance. However, these methods require a fine-tuning step after pruning to recover the lost accuracy.

[0005] Known methods are either not parameter-free, i.e. require a dedicated training process (e.g., generating masks as shown in a dynamic dual-gated neural network), or are not training-free (e.g., require a fine-tuning step after the pruning step). This means that existing trained models either require to be completely retrained from scratch or at least fine-tuned to make the pruning method feasible (accuracy / FLOPs trade-off). This leads to various problems. First, the requirement for retraining or fine-tuning increases energy and time consumption. Second, the fine-tuning step may lead to catastrophic forgetting, i.e., the performance of the model on the task it was originally trained on will drastically lose, especially when fine-tuning on data different from the data used in training. Finally, the requirement for additional training depends on the availability of the dataset used to train the underlying CNN.

[0006] The present invention eliminates these limitations as it does not require any fine-tuning or retraining steps and is completely parameter-free and data-free. Therefore, it can be used as a plug-and-play replacement for convolutional modules in CNN architectures, thereby directly reducing the computational cost in the form of FLOPs (floating point operations, which can be interpolated from the number of multiply-accumulate operations MAC, for example).

[0007] Advantages of the present invention

[0008] The present invention can be viewed as a structured pruning method, or more specifically, a channel pruning method. More precisely, the inventors propose a locality sensitive hashing (LSH) based convolutional module that can be used as a plug-and-play replacement for any conventional convolutional module, thereby immediately reducing FLOPs during inference. Therefore, the present invention removes the restrictive requirements that can reduce the computational complexity of CNNs, such as the requirements for retraining and / or fine-tuning or pruning models and training data dependencies. It provides a plug-and-play pruning solution to immediately reduce FLOPs in CNN architectures, while the prior art requires time-consuming retraining or fine-tuning steps. Summary of the invention

[0009] In a first aspect, a method is provided for efficiently computing a two-dimensional or three-dimensional convolution operation in, for example, a three-dimensional tensor. The computational efficiency is achieved by dynamically reducing the number of channels in each portion of the tensor individually. Preferably, the method is applied to a convolutional layer of a neural network.

[0010] The method begins with the following steps: receiving a tensor of input data to be processed specifically by the convolutional layer and in particular at least one filter of a convolutional layer and initialize the locality sensitive hash function. It should be noted that the order of the "receiving" and "initializing" steps can be changed arbitrarily. After initialization, the hash function can remain unchanged. The filter is preferably a 2-dimensional or 3-dimensional filter, comprising a plurality of (c in )2D filter kernel (k×k). The number of 2D or 3D kernels can be the same as the number of matrices included in the tensor along at least one dimension, for example, the number of 2D kernels c in Equal to the number of tensor arrangement matrices c in Note that the matrix merging described below is performed along a number of dimensions of the tensor equal to the number of filter kernels.

[0011] Then, what follows is a loop in which, for multiple 3-dimensional patches of the tensor Repeat the following steps. A 3D patch refers to a specified sub-tensor of the input tensor. The size of the patch is chosen to be (k+b×k+b), where for example b=2, and an overlap of two pixels / cells with neighbors is maintained along the second and third dimensions of the tensor, where the patch has the same size as the tensor along the first dimension. The second and third dimensions can be called spatial dimensions. Taking a patch from the tensor is equivalent to tiling the input into an area of ​​size (k×k) along the spatial dimensions while maintaining the overlap required for convolution operations with a kernel of size (k×k). In other words, the patch is cut out of the tensor along the second and third dimensions of the tensor. It should be noted that the second and third dimensions of the tensor span matrices. The first dimension of the tensor can be viewed as the dimension of the matrix arrangement, where different matrices along the first dimension can be called channels or slides. Therefore, the number of channels of the patch is the same as the number of channels of the tensor. It should be noted that the concept can also be extended to three-dimensional filters, where the patches of the tensor are sub-tensors of the tensor.

[0012] The first step of the loop comprises the following steps: slicing the current patch into a series of (cin) matrices (k+b×k+b) along a first dimension. This is then followed by the following steps: applying locality sensitive hashing to each of said matrices to determine a hash representation of each matrix. This is then followed by the following steps: merging matrices with substantially the same hash representation into a new matrix. The term “substantially” may be understood as assigning slightly different hash representations to the same hash bucket, which are defined by a predefined number of hyperplanes. This is then followed by the following steps: creating a simplified tensor (c ) by arranging the merged matrices into a series, in particular such that a two-dimensional matrix is ​​located face-to-face behind another matrix to obtain a three-dimensional simplified tensor. in,reduced ×k+b×k+b). Then the following steps follow: along the dimension ci of the filter kernel nThe concatenation is done in the same order as the matrices that have been concatenated. Typically, when performing a convolution, the filters are concatenated along the filter dimension ci. n Each filter kernel at a given position of (in particular, each kernel (k×k)) is applied to the matrix at the same position along the dimension cin of the subtensor. If at least two matrices at a given position are merged, the corresponding filter kernels at the same position in the filter are merged in a similar manner, in particular added. In other words, the corresponding kernels of the merged matrices are merged.

[0013] Then comes the step of convolving the reduced sub-tensor with the merged filter. Note that for the convolution step, the convolution is then implemented by sliding the reduced filter over the enlarged receptive field and applying the convolution during the sliding.

[0014] After the loop terminates, the following optional steps can be implemented: Output the results of all convolution operations for each patch.

[0015] It is suggested to implement the step of initializing the local sensitive hashing according to the estimated number of hyperplanes of the local sensitive hashing, wherein the number is estimated according to the computational resources of the computational unit implementing the convolutional layer. Preferably, the number of hyperplanes is at least 20 and should not exceed 60, preferably should not exceed 40.

[0016] In another aspect of the present invention, a computer-implemented method is proposed, which uses a neural network with efficient convolution according to the first aspect of the present invention as a classifier to classify sensor signals. The classifier is used by the method according to any of the previous aspects of the present invention, and the method comprises the following steps: receiving a sensor signal, the sensor signal comprising data from an imaging sensor; determining an input signal dependent on the sensor signal; and feeding the input signal to the classifier to obtain an output signal characterizing the classification of the input signal.

[0017] In another aspect of the present invention, a control system for operating an actuator is provided. The control system comprises a classifier according to any one of the above aspects of the present invention and is configured to operate the actuator according to an output of the classifier. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Embodiments of the present invention will be discussed in more detail with reference to the following drawings. These drawings show:

[0019] Figure 1 is a schematic flow chart of an embodiment of the present invention; and

[0020] Figure 2 is a schematic overview of the framework of an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The present invention describes a dynamic / online pruning scheme for convolutional neural networks (CNNs) such as ResNet or VGG. CNNs are a class of (deep) neural networks that are typically used for computer vision or image processing tasks. They are characterized by the use of convolutional filters that perform (discrete) convolutions on an input signal in a sliding window manner to produce an output signal. Multiple convolutional filters can be contained in a convolutional module. Many such modules are then chained together, typically with other modules such as batch normalization or activation functions (e.g. ReLU) to form a convolutional layer. Finally, a typical CNN such as ResNet typically uses multiple convolutional layers of different sizes to perform tasks such as image classification, or when used as a "backbone" (i.e. preprocessing step) / feature extractor, also semantic segmentation or object detection. In one aspect of the invention, a method is described for pruning channels (i.e. "slices") of an input signal provided to a convolutional module, thereby reducing the overall computational cost of processing the input while maintaining high performance.

[0022] The main aspects of the present invention revolve around reducing unnecessary computations when performing convolution operations on high-dimensional inputs, since the input signal often contains redundancies in the form of similar channels or slices within channels. However, in conventional convolution operations, all channels are treated as equally important, resulting in high computational costs. The present invention uses a scheme hereinafter referred to as locality sensitive hashing to detect these redundancies. It is an approximate nearest neighbor search method that clusters input slices together based on their similarity. Given this channel clustering, the redundant information in the input signal can be merged / minimized by performing cheap operations such as taking the mean or sum of these channels. Afterwards, convolution can be applied to the simplified input. Although performing the hashing and merging steps will add additional cost to the entire module, these operations combined with the convolution performed on the simplified input are still much cheaper than performing conventional convolution on the input with redundancy. This behavior mainly stems from the fact that the convolution operation itself is expensive, with many element-wise multiplications and additions performed. In addition, in a convolution module, the convolution is repeated for each convolution filter. Therefore, there is a small "one-time cost" of filtering out redundancies beforehand and computing their mean / sum, which in turn greatly reduces the repeated cost of computing convolutions later.

[0023] The invention has direct applications in autonomous driving, robotics, and other resource-constrained mobile applications of convolutional neural networks. In particular, for the processing of image sensor data, the size and computational complexity of AI models remain an issue. CNNs are often too large to fit on mobile hardware in terms of memory and latency requirements. Since model FLOPs directly measures how many computations a model needs to perform to produce an output given an input, reducing FLOPs offers the potential to save runtime (latency) and energy requirements on mobile devices.

[0024] More specifically, one can envision applications in system-on-chip video / image processing sensors where available computational resources are limited. Furthermore, mobile applications often require that available resources be shared between multiple computationally intensive modules. This may limit the maximum energy consumption or latency that a model is allowed to have. The present invention offers the potential to reduce both by reducing computational cost. Furthermore, other approaches may not be suitable for use due to data dependencies or retraining requirements. For example, models that are continuously trained on a video data stream cannot simply be retrained from scratch or easily fine-tuned through pruning to achieve reduced computational cost. Other models may also have expensive training processes that, in the worst case, will need to be repeated to successfully prune them. Our approach circumvents these limitations and provides significant FLOP reductions.

[0025] Preferably, the invention according to the claims is used for analyzing data obtained from sensors. The sensors can determine measurements of the environment in the form of sensor signals, which can be given, for example, by digital images, such as video, radio radar, lidar, ultrasound, motion, thermal images.

[0026] More preferably, the invention according to the claims is used to classify sensor data, detect the presence of objects in sensor data or perform semantic segmentation on sensor data, e.g. with respect to traffic signs, road surface, pedestrians and / or vehicles. This is implemented based on low-level features, such as edges or pixel properties of an image.

[0027] Below, a detailed description of the present invention for channel pruning in a convolutional neural network is given. The method is described for an arbitrary convolutional module because it can be applied to convolutional modules in a given network. Note the difference between the case of using convolution with a filter with a kernel size of k>=2 and convolution with a filter with a kernel size of k=1 (also called 1x1 convolution or point-by-point convolution).

[0028] When our proposed convolutional module is initialized, we construct the hash function in the following way: a set of L random hyperplanes are generated by their normal vectors. The vectors are generated in a sparse manner to save computational cost in the hashing process.

[0029] The locality sensitive hashing process is advantageous because it is a computationally inexpensive way to perform approximate nearest neighbor searches. We use a "random projection" scheme, which is particularly well suited for use in convolutional layers. However, alternatives such as MinHash or WinnerTakes All Hash (WTA Hash) may also be viable options.

[0030] When k>=2:

[0031] When using convolutional filters with kernel size k>=2, our goal is to prune larger patches rather than the smaller context window observed by the convolutional filter at each filter position p during the sliding window process. To do this, we hash the representation of each channel of a given patch in a locally sensitive manner, essentially clustering similar channels in hash buckets. We are then able to merge all approximately similar channels together, thereby reducing the channel dimension or depth of the input signal (patch). Similarly, we merge the corresponding channels of all convolutional filters in this module on the fly, also reducing their depth by the same amount. Note that the degree of reduction in depth depends on the input signal, allowing high compression ratios when the input is highly redundant. Furthermore, the compression ratio can also vary between filter positions, allowing particularly high compression to be achieved in redundant image regions.

[0032] While the merging operation itself is crucial to our approach, the specific choice of merging operation can be varied. Instead of taking the mean of the input channels, one could also try computing the element-wise maximum or median.

[0033] Finally, we are able to perform a regular convolution operation between the reduced input and the reduced filters, producing a regular sized output that can be immediately used by the next module in the chain without any changes.

[0034] When k=1:

[0035] When using point-wise convolutions, the hashing process needs to be changed to work properly. To do this, we rasterize the input into non-overlapping blocks of size 3x3 in the spatial dimension and zero-padded where necessary. Each patch can then be hashed similarly to the case above for k>=2, reducing the channel dimension of the input and filter. Inside each reduced patch, we can perform a 1x1 convolution with the filter, merging the filters to the same depth as the input patch by merging the corresponding channels. The output once again retains the shape that would normally be produced by the underlying convolutional module.

[0036] Locality sensitive hashing is a popular method for approximate fast nearest neighbor search in high-dimensional space. If the input domain x,y∈R d Similar vectors in receive the same hash code h(x)=h(y) with high probability, then the hash function h:R d→N is locality sensitive. This is in contrast to regular hashing schemes, which try to minimize hash collisions by spreading the input data widely across its hash buckets. More formally, we need a similarity measure for the input space and an appropriate hash function h. Cosine similarity is a particularly suitable metric for use in convolutional architectures, since convolving a (approximately) normalized kernel with a normalized input is equivalent to computing their cosine similarity.

[0037] Random Projection (RP) gives a family of optimal hash functions that group input data by cosine similarity. These functions partition the high-dimensional input space by L random hyperplanes, so that each input vector can be assigned exactly to a segment of this partition, called a hash bucket. Determine the input x∈R d The positions relative to all L hyperplanes are given by their normal vectors v l ∈R d , l∈{1, 2, ..., L}, and the entries of these normal vectors are taken from the standard normal distribution N(0,1).

[0038] By definition:

[0039] (Equation 1)

[0040]

[0041] We get a binary information that indicates which side of the lth hyperplane our input x lies on. The hyperparameter L controls the discriminative power of this method, transforming the input space R d Divide into a total of 2 L different regions or hash buckets. By linking all individual functions h l , we get the RP hash function:

[0042] (Equation 2)

[0043] h:R d →{0,1} L ,h(x)=(h 1 (x),...,h L (x)

[0044] Note that h(x) is an L-bit binary code that acts as a 2 L The identifier for exactly one of the hash buckets. Equivalently, we can convert this code to an integer, effectively moving the hash buckets from 0 to 2. L -1 to mark:

[0045] (Equation 3)

[0046] h:R d →{0,1,...,2L -1},h(x)=2 L-1 h L (x)+…+2 0 h 1 (x)

[0047] Although LSH has greatly reduced the computational complexity compared to the exact nearest neighbor search, binary code generation still requires L*d multiplications and L*(d-1) additions for each input. To further reduce the cost of this operation, the method proposed in Very Sparse RandomProjections.volume 2006,pp.287–296,082006.doi:10.1145 / 1150402.1150436 by Ping Li, Trevor Hastie, and Kenneth Church can be used. Instead of using a standard normal distribution vector v l , one can instead use a very sparse vector v l , containing only elements from the set {1,0,-1}. Given the target sparsity s∈(0,1), the hyperplane normal vector vl is randomly constructed so that only the expected number of s non-zero entries will appear. Suppose we choose s=1 / 3, then our normal vector v l Contains only d / 3 non-zero entries. Since the remaining entries are chosen to be -1 or 1, the dot product calculation is reduced to L*(d / 3-1) additions and 0 multiplications. This allows us to trade expensive multiplication operations for cheap additions.

[0048] After establishing LSH as a computationally inexpensive way to find approximate nearest neighbors in high-dimensional space via sparse random projections, we now aim to exploit this approach as a means of finding redundancy in the channel dimension of latent feature maps in convolutional models.

[0049] Formally, a convolutional layer can be constructed by adding a (padded) input feature map Slide up multiple learned filters And calculate the discrete convolution at each point to describe. Here, k is the kernel size, h and w represent the spatial dimensions of the input, and c in 、c out Describes the input and output channel dimensions respectively.

[0050] For any patch p and input Many channels contain similar information. However, for example, all channels It is convolved with its corresponding sliding kernel to produce the output, ignoring the existing redundancy.

[0051] We question this design choice and instead exploit redundant channels to save computation in convolution operations. To retrieve these channels, we propose to exploit the LSH scheme described above. More specifically, to group similar channels, we group all Flattened to (k+2) 2 This set of vectors is then centered around the mean along the channel dimension and hashed by h, resulting in a total of c in A hash code.

[0052] We then check which hash codes appear more than once, since the LSH scheme determines that all elements that appear in the same bucket are approximately similar. By grouping the vector representations of , we receive multiple sets of redundant feature map channels. These channels can then be merged to reduce the computational complexity of the convolutional module.

[0053] It is particularly noteworthy that our RP LSH method is invariant to the scaling of a given input vector. This means that k+b×k+b input channels with the same structure but different activation strengths are still located in the same hash bucket, effectively finding more redundancy in the channel dimension.

[0054] Redundant input channels After clustering into hash buckets, we can use this grouping to save FLOPs when performing convolution operations.

[0055] To avoid repeated computation on almost similar channels, we dynamically reduce the size of each input context window by merging channels in the same hash bucket. The merging operation is performed by taking the mean of all channels in a bucket. Therefore, the number of remaining input channels is reduced to

[0056] This allows us to define the compression ratio: This determines the relative reduction in feature map depth. Note that this ratio depends on the amount of redundancy in the input feature map X at filter position p. This enables us to dynamically prune channels, allowing different compression ratios to be achieved across images or even in different regions of the same input.

[0057] Similar to the way of reducing the depth of the input feature map, we merge the convolutional filters F l However, instead of hashing the filter channels as well, we can merge only those channels that correspond to the collapsed input channels. This merging step is done on the fly at each filter position p, preserving the original weights for the next filter position. Thus, the one-to-one correspondence of the channels remains intact, while also reducing the filter depth to Note that instead of taking the mean of the filter channels, we simply add them together. This way, the convolution between the reduced input window and the simplified filter retains the same output strength as the original convolution while requiring much less computation.

[0058] This method can be defined in pseudo code as follows:

[0059]

[0060] Although there is an additional computational cost to perform the merge operation on the hash sum of the input channels, the overall cost savings from computing the convolution operation on the reduced channel dimension outweighs the added overhead.

[0061] The above method acts as a direct plug-and-play replacement for any regular convolutional module in a CNN. It has only one hyperparameter L, which controls the amount of hyperplanes used in the LSH scheme. Its value directly determines the trade-off between compression ratio and preserving accuracy. When L is low, the random projections only coarsely divide the input channels into a few groups. While this leads to a high compression ratio, the resulting output feature maps may be very different from those of the full convolution operation, resulting in an overall degradation in model performance. Conversely, when L is large, we retain almost the full model performance at the expense of a lower compression ratio. Therefore, the choice of L allows generating multiple model variants from one underlying base model, for example focusing on low FLOPs or high performance.

[0062] The hyperparameter L, which determines the number of hyperplanes used in the hashing scheme, acts directly as a controller for the accuracy / FLOPs tradeoff. It can be tuned individually at each point in the network to find the ideal balance between model and hardware performance.

[0063] Figure 1 , in particular, together with the above pseudo code, an algorithm of the above method is shown, which includes a series of steps for processing input data of a CNN convolutional layer and merging channels by hashing and merging filter kernels according to the merging of channels, and then performing convolution to generate, for example, an output tensor of the convolutional layer.

[0064] The algorithm starts with step S11 "Initialize Hash Function", which initializes a hash function h. This function will be used to hash the data representation. Preferred choices of different hash functions have been discussed above.

[0065] In the following step S12, the algorithm enters a loop that iterates over each pixel in the input image or data point of the feature map of the convolutional layer. The loop traverses a patch p of the input image or feature.

[0066] In the following step S13, within the loop, an empty list called HashCode is created. This list is suitable for storing the hash codes generated for each channel of the input data at the current pixel or data point.

[0067] In the subsequent step S14, another nested loop is formed within the loop, which loops for each input channel i (from 1 to c). in ) is iterated on.

[0068] In the subsequent step S15, in a nested loop for each input channel, the representation x is calculated by centering and flattening the channel value at the current pixel p. i . This is done using the 'Center' and 'Flatten' operations. The result is a flattened vector.

[0069] In a subsequent step S16, the algorithm then applies the hash function f to the generated representation x i , thus generating a hash code. This hash code is appended to the HashCode list.

[0070] In the subsequent step S17, after processing all input channels at the current pixel, the algorithm merges these channels into a single bucket. This means that the algorithm combines the values ​​of all input channels at this pixel according to the calculated hash code. The result is stored as

[0071] In the following step S18, the algorithm merges corresponding filter channels from the filter set F based on the same hash code. The result is stored as F reduced The merging of filters is implemented similarly to the merging of channels, where instead of averaging the channels in a given bucket, the filters of the corresponding bucket are summed.

[0072] In the subsequent step S19, using the simplified input and the simplified filter F reduced , the algorithm performs a convolution operation (e.g., a standard convolution) to compute the output Y at the current pixel on the simplified input by convolving it with the simplified filter (p) Due to the two compressed data representations of the compressed filter and the compressed window, far fewer convolution operations must be implemented.

[0073] Finally, the algorithm returns an output tensor Y with the same dimensions as the input, but with the number of channels (c out )reduce.

[0074] Figure 2A simplified overview of the context window and filters is shown. Each patch of the input feature map is processed to find redundant channels. The detected redundancies are then merged together, reducing the depth of the sliding window and all convolutional filters.

Claims

1. A computer-implemented method for efficiently computing convolutions, particularly of a convolutional layer of a neural network, comprising the following steps: A tensor that receives input data to be processed specifically by the convolutional layer. and in particular at least one filter of a convolutional layer wherein the filter comprises a plurality of (cin) filter kernels (k×k); Initialize the locality sensitive hash function; Repeat the following steps for multiple patches of the tensor (X): Cut the current patch into a series of (cin) matrices (k+b×k+b); applying the locality sensitive hashing to each of the matrices to determine a hash representation of each matrix; Merge matrices with substantially the same hash representation into a new matrix; Create a reduced tensor (Ctn, reduced×k+b×k+b) by arranging the merged matrices in order; Merging the filter kernels in the same order as merging the matrices; as well as Convolve the reduced sub-tensor with the combined filters.

2. The method according to claim 1, wherein the step of initializing local sensitive hashing is implemented based on an estimated number of hyperplanes for local sensitive hashing, wherein the data is estimated based on the computing resources of a computing unit implementing convolution (in particular a convolutional layer).

3. The method according to claim 1 or 2, wherein the tensor is an image to be processed by the neural network or a feature map of a previous layer of the convolutional layer.

4. A method according to any preceding claim, wherein the neural network classifies its input based on a reduced sub-tensor convolved with a combined filter.

5. A method according to any preceding claim, wherein the size of the convolution filter is Cin×k×k, where k≥1 and k×k represents the kernel size.

6. A method according to any preceding claim, wherein the merging of the matrices is performed by averaging matrices having substantially the same hash representation or by taking the median or element-wise maximum of matrices having the same hash representation.

7. A method according to any preceding claim, wherein the merging of the filters is performed by summing the filter kernels corresponding to merged matrices having the same hash representation.

8. A method according to any preceding claim, wherein the receptive field is synthetically enlarged by at least one entry along each dimension (k+1 x k+1).

9. A computer program configured to cause a computer to implement the method according to any one of claims 1 to 8 and all its steps if the computer program is executed by a processor.

10. A machine-readable storage medium on which the computer program according to claim 9 is stored.

11. A system configured to implement the method according to any one of claims 1 to 8.