Questions tagged [conv-neural-network]

0

votes
0

answer
2

Views

Does normalizing images by dividing by 255 leak information between train and test set?

I've seen division by 255 used many times as normalization in CNN tutorials online, and this is done across the entire dataset before train test split. I was under the impression that the test set should be normalized according to the mean/std/maxmin etc. of the training set. By using /255 across th...
SCool
1

votes
2

answer
204

Views

“ ImportError: DLL load failed: The specified procedure could not be found”- while Digit Recognition using CNN in Python using Keras

I am trying to write a simple character recolonization code using convolutional neural network in python on windows. I am following this tutorial. But somehow I am having following error message. I could not find the appropriate reason of this error. It would be helpful for me if anyone can breakdow...
Mahin
1

votes
1

answer
87

Views

How do Convolutional Layers (CNNs) work in keras?

I notice that in the keras documentation there are many different types of Conv layers, i.e. Conv1D, Conv2D, Conv3D. All of them have parameters like filters, kernel_size, strides, and padding, which aren't present in other keras layers. I have seen images like this which 'visualize' Conv layers, b...
Primusa
1

votes
2

answer
41

Views

How to feed OpenCV image to a trained CNN model(add a new dimension) in Python?

I'm getting this error Error when checking input: expected conv2d_11_input to have 4 dimensions, but got array with shape (300, 300, 3) How can I pass the RGB image to a CNN? How to enumerate samples to create a 4D image?
Arshad_221b
1

votes
1

answer
45

Views

Why are the prediction probabilities so high for images with no defined class?

I have been stuck here for too long now. I am trying to create a CNN that could detect the numbers in an image. For this I started working with The Street View House Numbers (SVHN) Dataset. This dataset comes with pre-processed images scaled to 32x32 digits.There are 10 classes for 10 numbers. I t...
Amanda
0

votes
0

answer
4

Views

Should YOLOv3 annotations be done before the resize?

I am about to start annotating my images to train a YOLOv3 model. Before starting I want to make sure that it is okay to create the annotations on the original image. Would the annotations change respectively after I resize my images before training? Or should I resize all of my images first then st...
sugar.darre
0

votes
0

answer
5

Views

Issues splitting autoencoder model in Keras

I have trained an autoencoder and saved it using keras built in save() method. Now I want to split it into two parts: Encoder and decoder. I can successfully load the model and get the encoder part by creating a new model using the old model: encoder_model = keras.models.Model(inputs=self.model.inpu...
Matas Minelga
0

votes
0

answer
4

Views

Why is the model not learning with pretrained vgg16 in keras?

I am using the pre-trained VGG 16 model available with Keras and applying it on the SVHN dataset which is a dataset of 10 classes of number 0 - 10. The network is not learning and has been stuck at 0.17 accuracy. There is something that I am doing incorrectly but I am unable to recognise it. The way...
Amanda
-2

votes
0

answer
19

Views

How many number of neurons are in the first input layer model.add(Conv2D(64, kernel_size=(3, 3),input_shape=(200,200,3))

1)how many number of neurons in the input layer? I'm giving the input size of image as 200*200 2)I guess the number of neurons for input layer should be number of (features) pixels of an input image (in this case 200*200) 3)what if there are more number of neurons in the input layer than the feature...
Rohan Dhere
-1

votes
0

answer
18

Views

CNN model converges with small, grayscale dataset [DVMM] but not with a large, colour dataset [CASIA]

I created a CNN model, in which the first layer is initialized by 30 high pass filters (which act like edge detectors), to detect tampering in images. The model accepts input patches of size 128x128. It trains well on a grayscale dataset - DVMM Columbia dataset - and gives accuracy upto 90%. An exam...
Abdul Muizz
1

votes
1

answer
1.5k

Views

How to train CNN with an RGB Image

I am currently building a CNN to differentiate between a rotten apple and a normal apple. I feel that it would be of great benefit if I could feed the CNN with rgb images. However, what exactly do I need to change to the following network? x = tf.placeholder('float', [None, 784]) #y = tf.placeholder...
Rehaan Ahmad
1

votes
1

answer
40

Views

Should a 1D CNN need padding to retain input length?

Shouldn't a 1D CNN with stride = 1 and 1 filter have output length equal to input length without the need for padding? I thought this was the case, but created a Keras model with these specifications that says the output shape is (17902,1) when the input shape is (17910,1). I'm wondering why the dim...
John
1

votes
0

answer
640

Views

Applying a specific High pass filter on a RGB image in numpy

I'm trying to preproccess my image before feeding it to the CNN. Goal To extract the residual after applying a high pass filter( Reference 1 ) on a RGB image of dimensions 512x512 ( basically a shape of (512,512, 3) ) using the following equation: link to image where I is the Image and the matrix is...
Pradyumna Rahul
1

votes
0

answer
171

Views

How CNNs achieve spatial invariance despite having a Fully Connected layer at the end for classification?

An image of a dog should be learnt by the network as being a dog irrespective of the spatial position and or rotation (maybe even deformation?). My question is how CNNs are able to achieve this? The convolution operations on input image successfully detect a feature that is characteristic of a parti...
James Howlett
1

votes
1

answer
95

Views

output dimensions Mismatch CAFFE-SSD

While calculating the dimensions of the SSD Object Detection pipeline, we found that for the layer named 'pool3', with parameters: pooling_param { pool: MAX kernel_size: 2 stride: 2 } the input dimensions are 75x75x256 (WxHxC) and according to the formula: ( Wout = ( Win − kernel + 2*padding )/str...
Wahaj
1

votes
2

answer
1.5k

Views

Keras autoencoder negative loss and val_loss with data in range [-1 1]

I am trying to adapt keras autoencoder example to a my data. I have the following network: Xtrain = np.reshape(Xtrain, (len(Xtrain), 28, 28, 2)) Xtest = np.reshape(Xtest, (len(Xtest), 28, 28, 2)) input_signal = Input(shape=(28, 28, 2)) x = Conv2D(16, (3, 3), activation='relu', padding='same')(input_...
Randy Vogel
1

votes
2

answer
392

Views

i have trained MNIST with accuracy 99.2% but with wrong predictions

I have been using this program to predict my handwritten images to predict a number using previously trained data. The following is the program. please help me out.im new to this This code is used for image processing: import numpy as np import matplotlib.image as mpimg img=mpimg.imread(/images.png...
john joy
1

votes
0

answer
362

Views

Siamese networks Accuracy?

I'm using the contrastive loss layer from this paper: I've set the margin to a certain value. But I am not quite sure how I would calculate the accuracy for a classification task. As far as I know, I would calculate the euclidean distance from the features and check for a certain threshold. Would th...
Luke
1

votes
0

answer
402

Views

defining a siamese network in tensorflow

I know this question has been asked before, however I've a specific question which has not been answered before. I am trying to define a Siamese network in Tensorflow as follows: def conv(self, x, num_out_maps, ksize, stride, activation_fn=tf.nn.relu): padding_length = np.floor((ksize-1)/2).astype(n...
kunal18
1

votes
2

answer
123

Views

Seeing more than 10 test examples in Tensoboard

I am running the Tensorflow Object Detection API on a batch of 1000 labeled images, 80 of which I kept for testing. This is being done using the provided train.py and eval.py scripts, and also using one of the pipelines provided in the repo. After I get train.py and eval.py running, I run Tensorboar...
Alexander George
1

votes
1

answer
1.9k

Views

faster-rcnn config file in tensorflow

I am using Google API for object detection in tensorflow to train and infer on a custom dataset. I would like to adjust the parameters of the config file to better suit my samples (e.g. no. of region proposals, size of ROI bbox, etc.). To do so, I need to know what each parameter does. Unfortunately...
Hafplo
1

votes
0

answer
276

Views

Non-image Data Classification by Convolutional Neural Network

I have a dataset where attributes are numerical and also there are multiple class. I want to classify them using CNN in Python. Is it possible ? After a lot of searching in google, I did not find anything related to non-image data . All classification examples of CNN are done in images. Please give...
arifCoder
1

votes
0

answer
202

Views

model save in keras json file

I saw the two different kinds of model saving style in Keras. model.save(os.path.join(model_path, Filename)) and other one uses json and weight model_json = model1.to_json() with open('model1.json', 'w') as json_file: json_file.write(model_json) model1.save_weights('model1.h5') print('Saved model t...
james james
1

votes
1

answer
179

Views

Invalid argument error when using tf.reshape()

I am using some MNIST tutorials on convolutional neural networks to develop my own which can classify 15x15 into one of two classes. When defining the convolutional network I have encountered an invalid argument error but I can't figure out where I am going wrong. Here is the code I am using to defi...
haagn
1

votes
2

answer
237

Views

Does a Convolutional Layer Have an Exact Inverse

...and if so under what circumstances? A Convolutional Layer usually yields an output of lesser size. Is it possible to reverse/invert such an operation by flipping/transposing the used kernel and providing padding or likewise? Just looking at the convolutional layer's operation here - without pooli...
Dave
1

votes
0

answer
223

Views

Caffe net.forward call for multiple batches

I am using ImageData type of data in .prototxt file and trying to get the features from python code using net.forward() and net.blobs of caffe library. However, I get only 50 features after net.forward() call which is the batch_size which I have set in .prototxt file. How can I get the features for...
PallaviJog
1

votes
1

answer
45

Views

Understanding output of Convolutional Neural Network

I have been trying to understand Convolutional Neural Network but I mess up with its output size. The Formula is pretty much straightforward but I still end up confusing myself. I have learned from many sources on the Internet like deeplearning.ai of AndrewNg. So here is where I am getting confused....
vidit02100
1

votes
1

answer
200

Views

Conv1D does not update the weights. (All zero) and Test outputs are always same which is equal to Last layer Weights?

I would like to use 1D CNN to predict next day solar energy. The time series data resolution is one hour and the length is one year. I am training the model with the data of day 1 to predict day 2. xtrain = day1, ytrain = day2, xtest = day3 to predict day4. 24 hour data input -> CNN -> 24 hour outpu...
Reiso
1

votes
1

answer
45

Views

How to fix incorrect guess in image recognition

I'm very new to this stuff so please bear with me. I followed a quick simple video about image recognition/classification in YT and the program indeed could classify the image with a high percentage. But then I do have some other images that was incorrectly classified. On tensorflow site: https://w...
Bahamut
1

votes
0

answer
231

Views

How to understand RPN phrase in Faster-RCNN

Sorry, it is all by one question but relate to many small questions. I can't split them into seperated questions. For example, input picture size 960x640 Through VGG16 layer 13 Conv5_3, get feature_map 60x40x512 Do 3x3 convolution.     3.1 How 3x3 convolution compress the output above to 1x512...
Mithril
1

votes
1

answer
55

Views

Compicated error model in Tensorflow

I've been working on a CNN to localize a coin in an image. The CNN outputs a bounding box for the coin (x_min, y_min, x_max, y_max) and a few probabilities image_contains_coin, image_doesnt_contain_coin, coin_too_close (if the coin is too close to the camera), and dirty_coin if the coin is dirty (no...
Fries of Doom
1

votes
1

answer
143

Views

Is it possible to implement a loss function that prioritizes the correct answer being in the top k probabilities?

I am working on an multi-class image recognition problem. The task is to have the correct answer being in the top 3 output probabilities. So I was thinking that maybe there exists a clever cost function that prioritizes the correct answer being in the top K and doesn't penalize much in between these...
MLearner
1

votes
0

answer
61

Views

Run MatConvNet on CPU with maximum number of workers

I wish to run MatConvNet on CPU (no GPU at all), with 44 number of workers in parallel computing. Which part of the codes should be modified? Any help is highly appreciated.
Faranak
1

votes
0

answer
95

Views

Effect of adding/removing layers in CNN

I wanted to know about how adding layers or removing layers in a convolutional neural network affects the results produced. My problem specifically deals with detection of lips, something like this https://img-s3.onedio.com/id-57dc3cd17669c0cf0e4e2705/rev-0/raw/s-4909b77cbbb875d94fea9406a207936f767d...
Sarthak Agarwal
1

votes
0

answer
231

Views

Transform RGB image to *look like* Infrared

Context: I'm trying to improve a pose estimation model so that it works better when my camera is in Infrared mode. Unfortunately I only have RGB images to train on. I realize that you can't convert RGB to IR directly, but my hypothesis is that converting the RGB images to look more like IR, and the...
megashigger
1

votes
0

answer
51

Views

Why am i getting one weird plot in Tensorboard after running CNN Tensorflow example?

I am trying to visualize the plots in TensorBoard after running the CNN for mnist dataset using the example in their website. https://www.tensorflow.org/tutorials/layers I m getting 'test accuracy', 'training loss', 'global_step/sec' plots. However, i am also getting a weird plot as shown in the ima...
sam48
1

votes
0

answer
210

Views

Loss turns out to be nan in each epoch

I'm trying to implement a model to distinguish 7 different emotions. I'm using the VGG16 model from keras. I've removed the last 'softmax' layer(from the initial architecture) and introduced my softmax layer with 7 classes. I've used RMSprop optimizer. But, when fitting, the loss turns out to be nan...
Purusharth Soni
1

votes
0

answer
41

Views

Feature maps from network for multiple images all the same

I'm trying to extract the feature maps from a network, similar to what is done here, just for a list of images instead of just one. My code looks like this: net = caffe.Net(prototxt, weights, caffe.TEST) # ... for img_idx, img_path in enumerate(list_of_image_paths): img = caffe.io.load_image(img_pat...
KJoke
1

votes
1

answer
1.5k

Views

Can not convert a ndarray into a Tensor or Operation error in TensorFlow model

I am implementing a Wasserstein DCGAN in TensorFlow. The error occurs when this line is run : train_image = sess.run(image_batch). The handling of this exception throws another exception Fetch argument array([[[0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], [0, 0, 0, ..., 0, 0, 0], ..., [0, 0, 0,...
Tanmay Bhatnagar
1

votes
1

answer
386

Views

U-Net image segmentation with multiple masks

I basically have an image segmentation problem with a dataset of images and multiple masks created for each image, where each mask corresponds to an individual object in the image. All objects are of the same type, but the number of objects may vary. I am trying to train a U-Net with this data. I co...
Neil.C

View additional questions