What are deconvolutional layers?

I recently read Fully Convolutional Networks for Semantic Segmentation by Jonathan Long, Evan Shelhamer, Trevor Darrell. I don't understand what "deconvolutional layers" do / how they work. The relevant part is 3.3. Upsampling is backwards strided convolution Another way to connect coarse outputs to dense pixels is interpolation. For instance, simple bilinear interpolation computes each output $y_{ij}$ from the nearest four inputs by a linear map that depends only on the relative positions of the input and output cells. In …
Category: Data Science

Error after merging two Deep Learning models VGG16 and ResNet50

I have merged two different models namely VGG16 and ResNet50 and given the outputs of the two models as input to another model. I have checked the Layers graph is correct. Before merging the code was running perfectly fine giving correct outputs. I am getting an error: "ValueError: Shapes (None, None) and (None, 7, 7, 3) are incompatible" on the line 6 ValueError Traceback (most recent call last) <ipython-input-36-620554d0106f> in <module>() 4 epochs = 200, 5 validation_data = validation_generator, ----> …
Category: Data Science

Segmentation Network produces noisy output

I've implemented a SegNet and SegNet ReLU variant in PyTorch. I'm using it as a proof-of-concept for now, but what really bothers me is the noise produced by the network. With ADAM I seem to get slightly less noise, whereas with SGD the noise increases. I can see the loss going down and the cross-evaluation accuracy rising to 98%-99% and yet the noise is still there. On the left is the actual image, then you can see the mask, and …
Category: Data Science

Preserve colour in convolutional autoencoder

at the moment i work with convolutional autoencoder and now I'am looking for paper or methods that adresses a colour preversation. Most of the AE paper use grayscale images and loss functions such as SSIM that preserve the structure very well are also focused on grayscale images. My networks are good in preserving structure (with SSIM as loss) but have a hard time representing the right colour. I use a all convolution architecture without any pooling. my downsampling is derived …
Category: Data Science

Performing 1D Depthwise conv using Keras 2D Depthwise conv

I would like to perform a 1D Depthwise convolution (ie the first step of the depthwise-separable convolution) for a machine learning model I am working on. This means that for an input activation space of h x w, there are h kernels, each 1xk, where k is the length of the kernel (see attached figure). This is not currently offered by Keras, but one can use the available Depthwise 2D convolution (which operates on 3D inputs), and simply add an …
Category: Data Science

Does a rotational convolutional filter exist in neural networks?

Traditionally, a convolutional filter is one where you take a matrix of numbers, multiply it with a subset of the data, and then sum it up. Then you move the filter left to right and top to bottom in a sweeping fashion to generate a smaller (or equal) grid. But I wonder if there are filters that work in rotations meaning, consider a 2x2 filter containing these parameters. a, b d, c And consider a 4x4 input data. Normally, in …
Category: Data Science

tuning a convolution neural net, sample size

I keep reading that convolution neural net (CNN) performs best with lots and lots (100k+) of data. Is there any rule of thumb, or lower limit for data size during the grid search phase? For example, if I run a CNN with 100 data points, vary just one parameter (say add an extra layer, or increase a filter size), and get better results, can I reasonably expect better results with those parameters during the actual training phase?
Category: Data Science

Manual way to draw accuracy/loss graphs

During the training process of the convolutional neural network, the network outputs the training/validation accuracy/loss after each epoch as shown below: Epoch 1/100 691/691 [==============================] - 2174s 3s/step - loss: 0.6473 - acc: 0.6257 - val_loss: 0.5394 - val_acc: 0.8258 Epoch 2/100 691/691 [==============================] - 2145s 3s/step - loss: 0.5364 - acc: 0.7692 - val_loss: 0.4283 - val_acc: 0.8675 Epoch 3/100 691/691 [==============================] - 2124s 3s/step - loss: 0.4341 - acc: 0.8423 - val_loss: 0.3381 - val_acc: 0.9024 Epoch 4/100 …
Category: Data Science

Approach fpr extracting/cropping features images using deeplearning and no annotations

Let's say I want to have a bunch of images of hats from videos. How would I priniciple build something that would learn to recognize, and crop or bound box hats? I heard you need a dataset with bounding boxes manually drawn for training, but it seems there would be a way for a nn to identify that on their own? I'm trying to understand the possibility of scraping video for different items. I.e. give it images of 1000 hats, …
Category: Data Science

Patch wise training vs Full Convolutional Training in semantic segmentation

As mentioned in the title, what are those 2 methods? I already checked this question: Patchwise and Full training, (and the mentioned paper) but i can't really understand the meaning and the process of those 2 methods. What's the difference between the two? When should i prefer one instead of the other one?
Category: Data Science

What are features in computer vision?

I'm learning how U-NET network works to do semantic segmentation. I think I have understood everything but features. What are those image features? I read that convolutional layers extract features from the images using their filters, but what are they? Are they corners? edges? colours? I have read this article, "Finding Features", but I think I need more information about them.
Category: Data Science

Training a floor detection model: use full room images or only the cropped floor?

I'm trying to build a floor type image classification model.There's an open dataset called OpenSurfaces containing images segmented by the material type of every item appearing on a room. Something like this: I thought that using this dataset to train a floor detection model would be a good thing, so I wrote a script to extract the materials I'd like to detect (wood, tile, carpet, marble, stone, ...). These are some examples of the images I've got as a result …
Category: Data Science

How to approach the PlantVillage dataset?

I'm working on the PlantVillage dataset and i want to predict the type of the disease from the image of a leaf. The dataset is labeled in pairs (Type of the plant,Healthy/name of the disease). I'm wondering which approach from the following is better ? Should I build 2 neural nets, one for recognizing the type of the plant, and the second for the name of the disease. Or, should i build one neural net that predicts at the same …
Category: Data Science

Autoencoders for the compression of time series

I am trying to use autoencoder (simple, convolutional, LSTM) to compress time series. Here are the models I tried. Simple autoencoder: from keras.layers import Input, Dense from keras.models import Model import keras # this is the size of our encoded representations encoding_dim = 50 # this is our input placeholder input_ts = Input(shape=(2100,)) # "encoded" is the encoded representation of the input encoded = Dense(encoding_dim, activation='relu')(input_ts) #, activity_regularizer=regularizers.l2(10e-5) # "decoded" is the lossy reconstruction of the input decoded = Dense(2100, …
Category: Data Science

Why does the 1st derivative appear to lag the slope of the fit in Scipy's Savitzky-Golay filter?

I have a simple script that performs the Savitzky-Golay filter on a toy dataset of forex prices from yahoo finance: import scipy.signal price_series = pandas.read_csv('AUDUSD=X.csv').set_index('Date')['Close'] splinal_fit = scipy.signal.savgol_filter(price_series, window_length=21, polyorder=2, deriv=0, mode='mirror') splinal_fit = pandas.Series(splinal_fit, index=price_series.index, name='fit') splinal_deriv = scipy.signal.savgol_filter(price_series, window_length=21, polyorder=2, deriv=1, axis=0, delta=1) splinal_deriv = pandas.Series(splinal_deriv, index=price_series.index, name='fit') The fit and derivatives looks broadly sensible, however, the x-axis seems skewed. Here is what I ran to plot the derivative alongside the original fit: import matplotlib.pyplot as plt mask …
Category: Data Science

Why convolutions always use odd-numbers as filter size

If we have a look to 90-99% of the papers published using a CNN (ConvNet). The vast majority of them use filter size of odd numbers:{1, 3, 5, 7} for the most used. This situation can lead to some problem: With these filter sizes, usually the convolution operation is not perfect with a padding of 2 (common padding) and some edges of the input_field get lost in the process... Question1: Why using only odd_numbers for convolutions filter sizes ? Question2: …
Category: Data Science

NCHW input matrix to Dm conversion logic for convolution in cuDNN

I have been trying to understand the convolution lowering operation shown in the cuDNN paper. I was able to understand most of it by reading through and mapping various parameters to the image below. However, I am unable to understand how the original input data (NCHW) was converted into the Dm matrix shown in red. The ordering of the elements of the Dm matrix does not make sense. Can someone please explain this?
Category: Data Science

1D Convolution on multiple channels of varying length

Every datapoint in my dataset consists of 3 time series. The data in the time series is discretized into equal time-bins but the 3 time series were measured for varying length. Time series 1 has 10 bins, series 2 5 bins and series 3 only 1 single bin. So an exmaple datapoint looks like this 1, 4, 1, 7, 3, 7, 3, 7, 3, 1 9, 6, 4, 7, 1 4 I would like to run two 1D convolutional layers …
Category: Data Science

Inbetween CNN and MLP: neural network architecture for "close to convolutional" problem?

I am looking to approximate an (expensive to calculate precisely) forward problem using a NN. Input and output are vectors of identical length. Although not linear, the output somewhat resembles a convolution with a kernel, but the kernel is not constant but varies smoothly along the offset in the vector. I can only provide a limited training set, so I'm looking for a way to exploit this smoothness. Correct me if I'm wrong (I'm completely new to ML/NN), but in …
Category: Data Science

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.