Questions tagged [convolution]

A mathematical operation that combines two signals to generate a third signal. Convolution often arises in audio processing (e.g., filtering, reverb) and image processing (e.g., blurring, edge detection).

convolution
677 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3 votes
0 answers
3k views

Caffe ImageNet 32X32 images

So my problem consists of not being able to train the imagenet with smaller images (32X32) when i resize them to 256X256 everything starts training fine. So I know that the issue are my settings. i ...
Andriy Lysak's user avatar
3 votes
2 answers
1k views

Why does correlation using DFT give unintuitive results?

I was trying to compare how similar 2 signals using correlation via DFT (Digital Fourier Transform) in Matlab, but the correlation function gives not really predictable results. For example, if I ...
Arsen's user avatar
  • 153
3 votes
1 answer
433 views

When would I want to set a stride in the batch or channel dimension for TensorFlow convolution?

Tensor flow implements a basic convolution operation with tf.nn.conv2d. I am specifically interested in the "strides" parameter, which lets you set the stride of the convolution filter -- ...
snickers10m's user avatar
  • 1,729
3 votes
1 answer
1k views

Combining convolutional layers and LSTM layers with variable-length sequences

I am trying to combine Conv2D layers with LSTM layers on images. The problem is that the Conv2D layers takes as input a 4D tensor including the number of channels, and my LSTM network needs a 3D ...
Cyprien RUFFINO's user avatar
2 votes
0 answers
75 views

Why is there such a big difference in the execution time of the convolution operation with numpy?

Using the numpy convolution function, I found that convolution kernels of size 10000 or smaller perform much faster convolution time than kernels of size 10001 or larger. What is the reason for such a ...
Alexander's user avatar
2 votes
0 answers
359 views

Why is using python scipy's convolve function on a series of vector pairs in a for loop faster than using fftconvolve on two equivalent matrices?

To give some background, I am performing matched filtering between two batches of signals. The transmitted signals (i.e. the kernel) and the received signals (the 'data') are then represented by two ...
spaghettibadger's user avatar
2 votes
0 answers
996 views

Pytorch 2D convolution is somewhat slow

I am trying to replace a single 2D convolution layer with a relatively large kernel, with several 2D-Conv layers having much smaller kernels. Theoretically, the replacement should work much faster (in ...
Gil's user avatar
  • 177
2 votes
0 answers
334 views

How to implement convolution algorithm with SSE?

const int INPUT_SIGNAL_ARRAY_SIZE = 256896; const int IMPULSE_RESPONSE_ARRAY_SIZE = 318264; const int OUTPUT_SIGNAL_ARRAY_SIZE = INPUT_SIGNAL_ARRAY_SIZE + IMPULSE_RESPONSE_ARRAY_SIZE; __declspec(...
mkip's user avatar
  • 71
2 votes
0 answers
104 views

Calculating Convolution Only for a Certain Interval Using "conv()" in MATLAB

Below you can see the code for convolution of two continuous functions. There is a function called fx which I took as the square root of a Gaussian distribution. The convolution is calculated using 2 ...
Ali Pedram's user avatar
2 votes
0 answers
99 views

Locally connected 2D layer without summation over colors - keras

I want to create a neural network with a locally connected layer but without summation over the 3rd dimension (colors) of the inputs. I saw in the docs of LocallyConnected2D that there is no "...
hihi's user avatar
  • 55
2 votes
0 answers
1k views

efficient SIMD dot product in rust

I'm trying to create efficient SIMD version of dot product to implement 2D convolution for i16 type for FIR filter. #[cfg(target_arch = "x86_64")] use std::arch::x86_64::*; #[target_feature(...
user1685095's user avatar
  • 5,953
2 votes
0 answers
157 views

Implementation of FitzHugh-Nagumo diffusion model diverging by first iteration

I'm trying to implement the model described in this paper, which simulates the equation proposed by Alan Turing of the FitzHugh-Nagumo model in 2D as a model for forming animal skin patterns — in ...
micycle's user avatar
  • 3,508
2 votes
1 answer
2k views

Applying a mask to Conv2D kernel in Keras

I'm looking to apply a mask to the kernel of a Conv2D layer in Keras. I'm having a bit of difficulty understanding kernel shape. For kernel_size = 3, and filters = 1, the shape of the kernel is (3, 3, ...
Parham's user avatar
  • 69
2 votes
1 answer
127 views

Using CNN to get value from dartboard where dart landed

I want to use CNN in python to get values from dartboard (or the value of the field where dart landed) using pictures. I took 208 photos of dartboard, in each dart is in specific location. I want to ...
Samo Šimenko's user avatar
2 votes
0 answers
131 views

How can I filter images together in 3 dimensions

I have a sequence of images and I want to filter them in 3 dimension. The spatial filter is gaussian filter and for temporal filtering I use sinc filter so as spatial an temporal kernels are separable,...
Brier_98's user avatar
2 votes
0 answers
385 views

C# Convolution algorithm is producing a very loud .wav file

I am trying to create a convolution reverb algorithm that takes a sound input signal and convolves it in the frequency domain with an impulse response. I have been trying to debug the code for a week ...
M.Dyrholm's user avatar
2 votes
0 answers
254 views

how to convert TensorFlow Conv2D with kernel_regularizer into PyTorch

hello I have a layer defined as bellow: tf.keras.layers.Conv2D(filters=32, kernel_size=1, kernel_regularizer=tf.keras.regularizers.l2(l=0.05)) right now I would like to convert it into PyTorch but I ...
lbai's user avatar
  • 31
2 votes
0 answers
1k views

Bilinear interpolation by convolution

I tried to do the upsampling by transposed convolution.Since I was unable to figure out the kernel weights,I tried the following way. Upsample image by a factor of (using nearest neighbour method) ...
Knilakshan20's user avatar
2 votes
1 answer
640 views

Evaluating convolution of two continuous functions using fftconvolve

I am trying to evaluate the convolution of two continuous functions using scipy.signal.fftconvolve. The scenario of the code is as following: I am trying to approximate the following double integral: ...
Sato's user avatar
  • 1,083
2 votes
0 answers
204 views

Unknown output dimension of dilated convolution produces error on downstream Concatenate Layer

I'm trying to implement a simplified module like wavenet with dilated convolutions. A simple example is below: import tensorflow as tf tfkl = tf.keras.layers output_dim = 3 def waveres(inpt, ...
Jed's user avatar
  • 658
2 votes
0 answers
225 views

Alternative implementation of sparse convolution in TensorFlow

I have a special convolution kernel: 1) it has a big size (600x600); 2) it is a sparse filter and consists of mostly 0 values and some 1s. I want to apply this kernel to another big image (2000x2000). ...
hsiaomichiu's user avatar
2 votes
1 answer
548 views

Trying to get Convolution of Single Image

I am trying to get the result of a single convolution over an image using tf.keras.backend.conv2d. The specifications of the input are 227 pixels by 227 pixels, with a channel size of 3 (RGB image.) ...
CodeOnTheCob's user avatar
2 votes
1 answer
350 views

Problem regarding the weights and biases in CNN

I am currently learning about CNN. Till now I have understood the following: We pass the image as an input. In the 1st Convolution layer, we apply all the filters to the 2d image and apply an ...
pr22's user avatar
  • 179
2 votes
1 answer
2k views

Convolving sobel operator in x direction in frequency domain

I implemented the code given by Cris Luengo for convolution in frequency in domain, however I'm not getting the intended gradient image in x direction. Image without flipping the kernel in x and y ...
Shivam Thakur's user avatar
2 votes
0 answers
11 views

Group Convolution Weights in Pycaffe

I am trying to implement depth wise convolution in Mobilenet V2 in caffe. I do this by setting the parameter in conv_param num_output to be equal to the groups param. Taking 112x112x96 input ...
KL2208's user avatar
  • 21
2 votes
0 answers
649 views

Convolution using Matlab's conv() function

This is a supplementary question of this question. According to the documentation, len(output) = len(input) + len(kernel) - 1 So, I figured out In case of conv(u,v,"full"): len(pad) = len(...
user366312's user avatar
  • 16.6k
2 votes
2 answers
2k views

Fitting an exponential decay using a convolution integral -

I'm fitting the following data where t: time (s), G: counts, f: impulse function: t G f -7200 4.7 0 -6300 5.17 0 -5400 4.93 0 -4500 4.38 0 -3600 4.47 0 -2700 4....
Gerard's user avatar
  • 45
2 votes
0 answers
415 views

Captcha Recognition using CNN not giving expected results

I tried to develop a Captcha Recognition program using TensorFlow in Python. When I started, I checked some articles on the internet and found that a Captcha image is segmented into individual digits ...
KayKay's user avatar
  • 133
2 votes
1 answer
670 views

Comparing numerical and analytical convolution

I am calculating the convolution of two functions, exp(-bt^2 + iat) and exp(-c|t| + iat). If try to analytically calculate it in Mathematica with Convolve[Exp[-b*t^2 + I*a*t], Exp[-c*Abs[t] + I*a*t],...
Medulla Oblongata's user avatar
2 votes
1 answer
3k views

tf.nn.conv2d_transpose gives InvalidArgumentError: Conv2DCustomBackpropInput: input and filter must have the same depth

I'm facing issues with getting tf.nn.conv2d_transpose to work correctly. Here is a small reproduction of what I'm trying to do: import tensorflow as tf import numpy as np # Shape (2, 3, 3, 1) == (...
narrkey's user avatar
  • 21
2 votes
1 answer
1k views

Getting wrong prediction for cnn (Dogs Vs Cat ) Keras

I have programmed convolutional neural network in keras to predict whether the image is of a cat or a dog. I got an accuracy around 80%. I tried checking the prediction of my code for many images as ...
vidit02100's user avatar
2 votes
1 answer
365 views

Transposed convolution TensorFlow padding for FCN style networks

I am implementing some variants of FCN for Segmentation. In particular, I have implemented a U-net architecture. Within the architecture, I am applying valid convolution with a 3x3 kernel and then I ...
simongraham's user avatar
2 votes
1 answer
407 views

Tensorflow convolution vs. Tensorflow multiplication and sum vs. Numpy multiplication and sum

I am experiencing different results (on 16th least significant bit) while performing a single step of a dot product, implemented differently in TF and numpy. The inputs are float32 5x5 image and 5x5 ...
Contour's user avatar
  • 95
2 votes
0 answers
461 views

TensorFlow conv2d slow compared to others

I'm trying to use TF to do some filtering. I have 60 images of size 1740 x 2340 and a guassian filter of size 16 x 16. I ran a conv2d as strides = [1,1,1,1] data_ph = tf.constant(data,tf.float32) ...
user3347617's user avatar
2 votes
0 answers
299 views

"IndexError: tuple index out of range" using keras backend in straightforward way

I just try to make convolution of my tensor with shape (1,18,18,1) with custom tensor kernel_x = K.variable([[-1, -2, -1], [0, 0, 0], [1, 2, 1]]) I use this: y_true_boundary_x = K.conv2d(y_true, ...
Alexey Bohovkin's user avatar
2 votes
0 answers
218 views

What's wrong with my batch normalization in Tensorflow?

I was implementing a CNN for Digits Recognizer in Kaggle. The structure is: conv5x5(filters=32)-conv5x5(filters=32)-maxpool2x2-conv3x3(filters=64)-conv3x3(filters=64)-maxpool2x2-FC(512)-drop(keep ...
Daniel H. Leung's user avatar
2 votes
0 answers
1k views

Tensorflow Conv2D SAME padding when Stride is larger than Kernel Size

I'm running into a weird issue trying to compare my implementation of a convolution operator with tensorflow's dealing with the SAME padding. According to this post the SAME padding is calculated as ...
Paul's user avatar
  • 317
2 votes
0 answers
818 views

YOLO Loss function decreasing accuracy

I am having some issues implementing the YOLO loss function. Everytime I train my model, my loss decreases but my accuracy also decreases. This leads me to believe that my loss function is not correct....
Michael Bawol's user avatar
2 votes
0 answers
244 views

Decoder in Convolutional LSTM

I am trying to implement the convolution lstm network based on this paper: https://arxiv.org/abs/1506.04214, I have implemented the encoder like this: def new_convLSTM_layer(input, # The ...
MRM's user avatar
  • 1,159
2 votes
1 answer
450 views

Simple convolution in nd4j

I can't get a simple convolution to work in nd4j and documentation regarding this specific topic is scarse. What I'm trying to do: INDArray values = Nd4j.create(new double[]{1, 2, 3, 4, 5, 6, 7, 8, 9,...
Anthony De Smet's user avatar
2 votes
0 answers
3k views

Is there a C/C++ implementation of Tensorflow conv2d?

Is there a C/C++ implementation of the Tensorflow conv2d. I am looking for some code easy to read and not necessary optimized. There is a very brief description https://www.tensorflow.org/api_docs/...
GDG's user avatar
  • 407
2 votes
3 answers
975 views

Color change during Super-Resolution

I am working on a CNN that does Super-Resolution. The training goes well, there is no overfitting but when I try the trained network on a low-res image, the output image has changed its color : The ...
Nathan Hubens's user avatar
2 votes
1 answer
2k views

Trying to calculate the mean of a sliding window of an image Python

I'm trying to pixelate (\mosaic) an image by calculate the mean of a (non overlap) sliding window over the image. For this I try to implement a "window size" and a "step" parameters. Assuming my step ...
Evya IL's user avatar
  • 21
2 votes
0 answers
1k views

pytorch inplace operation error. How to get around it?

Using PyTorch in python, I'm feeding-back one of my CNN's layers into input-space by using an inverse network that I'm training. However, I'm interested in the representation of only one channel. I ...
SumakuTension's user avatar
2 votes
1 answer
124 views

CNN - What is every single kernels of the second conv-layer exactly convoluted with?

I'm a student in acoustics and really new at deep learning. My goal is to get a good understanding in how a CNN exactly works. There is one part that I don't understand. I can't find any precise ...
DanielH's user avatar
  • 21
2 votes
0 answers
120 views

Tensorflow: Define a conv2d-like operation

I want to define a new operation which should work the same way tf.conv2d works. Looking at the documentation, I should implement Compute(OpKernelContext* context) member method of my new operation ...
D.Badawi's user avatar
  • 175
2 votes
0 answers
138 views

TimeDistributed Model Not learning

I am trying to train model to play Chrome Dino (the offline game). The idea was to have 6 last screenshots of the game, use CNN on each separately (to extract features) and then put those features ...
P. Kon's user avatar
  • 85
2 votes
1 answer
753 views

tensorflow conv2d memory consumption explain?

output = tf.nn.conv2d(input, weights, strides = [1,3,3,1], padding = 'VALID') My input has shape 200x225x225x1, weights is 15x15x1x64. Hence, the output has shape 200x71x71x64 since (225-15)/3 + 1 = ...
Tu Bui's user avatar
  • 1,682
2 votes
0 answers
215 views

Merging two CNNs with an additional input vector to a resulting third CNN in keras

The architecture is two identical networks receiving different inputs. The first network receives a real-valued vector, the second receives a Boolean-valued vector. The first layer of each network is ...
user avatar
2 votes
0 answers
200 views

Implement a custom layer after a series of MPSCNNConvolution

I have a custom neural net here, made mostly of the usual building block (conv, relu, max pool, etc). But the last layer needs a sigmoid on some feature channels, and softmax on others (trying to ...
mtourne's user avatar
  • 440

1
2
3 4 5
14