Questions tagged [cnn]

Convolutional Neural Networks (CNN, also called ConvNets) are a tool used for classification tasks and image recognition. The name giving first step is the extraction of features from the input data.

Filter by
Sorted by
Tagged with
35 votes
6 answers
16k views

Why do convolutional neural networks work?

I have often heard people saying that why convolutional neural networks are still poorly understood. Is it known why convolutional neural networks always end up learning increasingly sophisticated ...
Praise the lord's user avatar
26 votes
1 answer
29k views

back propagation in CNN

I have the following CNN: I start with an input image of size 5x5 Then I apply convolution using 2x2 kernel and stride = 1, that produces feature map of size 4x4. Then I apply 2x2 max-pooling with ...
koryakinp's user avatar
  • 436
59 votes
3 answers
114k views

How to set batch_size, steps_per epoch, and validation steps?

I am starting to learn CNNs using Keras. I am using the theano backend. I don't understand how to set values to: batch_size ...
Ermene's user avatar
  • 693
10 votes
3 answers
5k views

How to use a dataset with only one category of data

I am performing a classification task, to try to detect an object. A picture of the environment is taken, candidates are generated of this possible object using vision algorithms, and once isolated, ...
Finn Williams's user avatar
10 votes
2 answers
19k views

Using Cross Validation technique for a CNN model

I am working on a CNN model. As always, I used batches with epochs to train my model. When it completed training and validation, finally I used a test set to measure the model performance and generate ...
Hunar's user avatar
  • 1,127
7 votes
2 answers
802 views

An error with respect to filter weights in CNN during the backpropagation

Let's say a convolutional layer takes an input $X$ with dimensions of 5x100x100 and applies 10 filters $F$ 5x5x5, thus produces an output $O$ 10 feature maps 96x96. During the backpropagation the ...
koryakinp's user avatar
  • 436
7 votes
3 answers
6k views

Is there any proven disadvantage of transfer learning for CNNs?

Suppose I know that I want to use a ResNet-101 architecture for my specific problem. There are ReseNet-101 models trained on ImageNet. Is there any disadvantage of using those pre-trained models and ...
Martin Thoma's user avatar
  • 18.8k
4 votes
2 answers
4k views

Should the bias value be added after convolution operation in CNNs?

Should we add bias to each entry of the convolution then sum, or add bias once at end of calculating the convolution in CNNs?
Green Falcon's user avatar
  • 13.9k
4 votes
1 answer
290 views

Fine-tuning a CNN for recognizing two classes, but also being able to tell if none of them is present in an image

I need to fine-tune a CNN to classify two classes: dogs and cats, for example. However, I want the CNN to be able to tell if ...
perdigas91's user avatar
4 votes
2 answers
10k views

Math behind 2D convolution for RGB images

I read many threads discussing why 2D convolutional layer is typically used for RGB images in neural network. I read that it is possible to use 3D conv layer. What I do not understand is the math ...
Hiro Nakagame's user avatar
3 votes
1 answer
4k views

Example of 1D ConvNet filter

I understand Conv2D filters. I think I understand Conv1D filters as well but have not seen any examples of the filters like what ...
Prabhat's user avatar
  • 131
3 votes
2 answers
8k views

Understanding Training and Test Loss Plots

I have attached a figure that contains 6 subplots below. Each shows training and test loss over multiple epochs. Just by looking at each graph, how can I see which one is the best? Which ones are ...
Muhammad Hanif Sarwari's user avatar
2 votes
1 answer
71 views

Using the validation data

I'm unclear on the exact process of using the validation data. Let's say that I fit my neural network model and adjust hyperparameters using the training set and validation set. Do I then evaluate ...
monkeyofscience's user avatar
25 votes
4 answers
71k views

What is a channel in a CNN?

I was reading an article about convolutional neural networks, and I found something that I don't understand, which is: The filter must have the same number of channels as the input image so that the ...
J.D.'s user avatar
  • 851
23 votes
1 answer
6k views

How to add non-image features along side images as the input of CNNs

I'm training a convolutional neural network to classify images on fog conditions (3 classes). However, for each of about 150.000 images I also have four meteorological variables available that might ...
Josh's user avatar
  • 487
18 votes
2 answers
33k views

In CNN, why do we increase the number of filters in deeper Convolution layers for complex images?

I have been doing this online course Introduction to TensorFlow for AI, ML and DL. Here in one part, they were showing a CNN model for classifying human and horses. In this model, the first ...
Sanjay Saha's user avatar
11 votes
1 answer
1k views

What are "VGG54" and "VGG22" derived from the VGG19 CNN?

In the paper Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network by Christian Ledig et al., the distance between images (used in the loss function) is calculated from ...
Lafayette's user avatar
  • 604
9 votes
1 answer
3k views

What is the memory cost of a CNN?

I was recently thinking about the memory cost of (a) training a CNN and (b) inference with a CNN. Please note, that I am not talking about the storage (which is simply the number of parameters). How ...
Martin Thoma's user avatar
  • 18.8k
7 votes
3 answers
3k views

Are CNNs insensitive to rotations and shifts in images?

Can CNNs predict well if they are trained on canonical-like images but tested on a version of images that are little bit shifted? I tried it using ...
Boris's user avatar
  • 463
6 votes
1 answer
833 views

Should I prevent augmented data to leak to the test/cross validation sets

I have been working with the cats vs dogs dataset from kaggle which consist on 25000 images of cats and dogs labelled accordingly (btw, great dataset, totally recommended!) One of the things I did ...
Juan Antonio Gomez Moriano's user avatar
5 votes
2 answers
749 views

Feeding 3 consecutive video frames to a CNN to track a tennis ball

I want to use CNN transfer learning to track a tennis ball from TV broadcasts of tennis matches. I used VGG annotating tool annotation tool link (use version 1 of the tool for compatibility with ...
mLstudent33's user avatar
5 votes
3 answers
19k views

How to make a CNN predict a continuous value?

I understand the dimensionality of convolutions, max pooling and dense as function of stride and kernel size. But I'm having trouble wrapping my head around how to use these layers to end up with my ...
Derek Fulton's user avatar
5 votes
1 answer
19k views

Accuracy and loss don't change in CNN. Is it over-fitting?

My task is to perform classify news articles as Interesting [1] or Uninteresting [0]. My training set has 4053 articles out of which 179 are Interesting. The validation set has 664 articles out of ...
Shreyans Jasoriya's user avatar
5 votes
1 answer
1k views

How to propagate error back to previous layer in CNN?

I have a convolutional layer (link) with an input 5x5x2 (width, height, depth): The layer has 3 filters with dimensions 3x3x2, it produces an output with dimensions 3x3x3. I have completed the ...
koryakinp's user avatar
  • 436
5 votes
1 answer
1k views

Multi Class + Negative Class Image Classification Strategies

I have seen a recurring theme in real-world problems I've worked with, where the problem looks something like "build an image classifier that recognizes classes A, B, and C but if the input is not ...
J Trana's user avatar
  • 151
4 votes
3 answers
8k views

Number of Fully connected layers in standard CNNs

I have a question targeting some basics of CNN. I came across various CNN networks like AlexNet, GoogLeNet and LeNet. I read at a lot of places that AlexNet has 3 Fully Connected layers with 4096, ...
Abhishek Saxena's user avatar
4 votes
4 answers
1k views

Why are deep learning models unstable compare to machine learning models?

I would like to understand why deep learning models are so unstable. Suppose I use the same dataset to train a machine learning model multiple times (for example logistic regression) and a deep ...
Kyv's user avatar
  • 151
4 votes
2 answers
7k views

What is the shape of conv3d and conv3d_transpose?

I want to do a GAN with coloured pictures. This means I need a three dimensional input and therefore I like to use conv3d and conv3d_transpose. Unfortunately in the TensorFlow documentation, I can't ...
snowparrot's user avatar
4 votes
1 answer
2k views

Why do pre-trained CNNs use low image resolution?

I want to use a pre-trained convolutional network for image classification. My base data has resolutions of 500x500px up to 1000x1000px. Pre-trained architectures often expect less (between 255 and ...
Gegenwind's user avatar
  • 488
4 votes
1 answer
162 views

Is it a red flag that increasing the number of parameters makes the model less able to overfit small amounts of data?

I'm training a deep network (CNN-LSTM-CRF) for Named Entity Recognition. Is there a reason that increasing the number of parameters would make the network less able to overfit a small training set (~...
Solveit's user avatar
  • 141
4 votes
1 answer
3k views

CNN backpropagation between layers

I have this CNN architecture: I know how to calculate error for weights based on the output and update weights between output<-->hidden and hidden<-->input layers. The problem is that I have ...
user63067's user avatar
4 votes
2 answers
6k views

What are the possible approaches to fixing Overfitting on a CNN?

Currently I am trying to make a cnn that would allow for age detection on facial images. My dataset has the following shape where the images are grayscale. ...
BearsBeetBattlestar's user avatar
3 votes
2 answers
9k views

What's the purpose of padding with Maxpooling?

As mentioned in the question, i've noticed that sometimes there are pooling layers with padding. More specifically, I found this Keras tutorial, where there's a net which contains ...
Mattia Surricchio's user avatar
3 votes
1 answer
1k views

How to find the various matrix sizes in designing a CNN

I am trying to understand CNN especially the maths and working mechanism using Matlab as the coding language. I have few confusion regarding the concept and the associated programming and will be ...
Sm1's user avatar
  • 521
3 votes
3 answers
4k views

Can pooling ever increase accuracy in convolutional neural networks?

In ConvNets, pooling is used to downsize the input volume, leading to fewer parameters, leading to computational efficiency and possibly helping with overfitting. But can pooling ever increase the ...
anonuser01's user avatar
2 votes
2 answers
417 views

When a dataset is huge, what do you do to train with all the images on i t?

I'm using Python 3.7.7. I'm trying to load a lot of NIFTI images using SimplyITK and Numpy from the [BraTS 2019 dataset][1]. This is the code I use to load the images into a numpy array. ...
VansFannel's user avatar
2 votes
1 answer
2k views

Convolution over volume in CNNs

I have a simple question about convolution layers in CNNs. Consider that we have 32 features map with size $100\times100$. So, can we set 16 convolution layer with size $9\times9\times16$ after ...
saeed masoomi's user avatar
2 votes
2 answers
628 views

Convolution Neural Networks on microcontrollers

I am wondering if an already trained convolutional neural network can be represented as a formula just like a perceptron can ($x_1w_1 + x_2w_2 + \ldots =$ PREDICTION). I know that the formula could be ...
Jose Luis Montalvo Ferreiro's user avatar
2 votes
1 answer
1k views

Massive variation in results with tensorflow and keras

I'm new to Tensorflow and Keras and I some background knowledge of how CNN's work. I'm using a basic sequential model based on the code by https://pythonprogramming.net/convolutional-neural-network-...
Bram Kreuger's user avatar
2 votes
1 answer
4k views

How to use TimeDistributed fo CNN+LSTM?

I am trying to classify 6 classes time-frequency domain signal (STFT spectrogram) with a size of 3601x217 pixels. Assume that for each classes have 70 training samples, 20 validation samples, and 10 ...
user2754279's user avatar
1 vote
1 answer
746 views

Implementing U-Net segmentation model without padding

I'm trying to implement the U-Net CNN as per the published paper here. I've followed the paper architecture as closely as possible but I'm hitting an error when trying to carry out the first ...
TomSelleck's user avatar
1 vote
0 answers
60 views

CNN regression. help to improve current model [closed]

I have time series grey scale images that show movement of fluid with different densities. I want to predict a pixel value for time t, with (t-3),(t-2),(t-1) 2D images as inputs. I am figuring out how ...
Rex's user avatar
  • 11
1 vote
3 answers
2k views

Why do we scale down images before feeding them to the network?

I have been seeing a lot where images are generally scaled down to either $64\times64$, $32\times32$ or other lower resolutions. Can someone please help me with this and answer a few questions: Don't ...
thanatoz's user avatar
  • 2,395
1 vote
0 answers
268 views

Keras val_acc unchanging when training (same label assigned to all images)

I am using Keras to make a "set" identifier for the card game Set. Here is my script (some code may be unnecessary but was used during experimentation): ...
keyan.r's user avatar
  • 29
1 vote
1 answer
495 views

Implement the following loss function without interrupting the gradient chain registered by the gradient tape

I have spent five days trying to implement the following algorithm as a loss function to use it in my neural network, but it has been impossible for me. Impossible because, when I have finally ...
VansFannel's user avatar
1 vote
0 answers
56 views

Warning during training a CNN

I was training a CNN when the following appeared: after this the training continue, but I don't understand why it happens. Should I do something or leave it? [EDIT] The problem is that it does this ...
J.D.'s user avatar
  • 851
1 vote
1 answer
204 views

How to use CNN to deal with a 2D regression problem?

I have seven measurements (Obs1-7), each measurement has the dimension of [x,y,t] where x and y are coordinates and t is time. Now I want to build a model that uses the first 6 measurements to predict ...
Zhendong Cao's user avatar
1 vote
2 answers
430 views

Why does my model sometimes not learn well from same data?

I have a dataset of 2 classes, both containing 2K images. I have split that into 1500 images for training and 500 images for validation. This is a simple structure for testing purposes, and each ...
ManInMoon's user avatar
  • 105
1 vote
2 answers
115 views

Why does adding random pixels stop my model learning in cnn?

I am using a very simple model to classify a 224x224 RGB image. For a test, I have labelled my images (2 labels "Green" or "Red", 2,000 images of each) based on colour of a single fixed pixel from ...
ManInMoon's user avatar
  • 105
0 votes
0 answers
32 views

Gradients of lower layers of a CNN when gradient of an upper layer is 0?

Say we have a convolutional neural network with an input layer, 3 convolutional layers and an output layer. Say the gradients with respect to the weights and biases of the third convolutional layer ...
VJ123's user avatar
  • 147