Training CNN for Regression Background: I am using CNN to predict forces acting on a circular particle in a granular medium. Based on the magnitude of the forces, particle exhibits different patterns on its surface. The images are greyscale, 64-by-64 pixels. You can see different pictures with the magnitude of the corresponding force on the x-axis attached below.

My attempt at solution: I am relatively new to deep learning and data science and decided to use a simple conv net to run a regression. My code is provided below. I tried to fit the model using adam optimizer and mse as a loss function, but it takes forever and sometimes aborts execution by itself. What could be the problem? I am running it on a PC with 8GB RAM, 1TB SSD, Intel i7 CPU, and GTX 1080 GPU. 

def build_model():

model = Sequential()
model.add(Conv2D(64, kernel_size=(3, 3), strides = (1,1), 
             padding = 'valid', activation='relu',
             input_shape=input_shape))

model.add(Conv2D(64, kernel_size = (3, 3), strides = (1,1), 
                 padding = 'valid', activation='relu'))

model.add(MaxPooling2D(pool_size=(2, 2), strides = (2,2)))

model.add(Dropout(0.25))
model.add(Flatten())
model.add(Dense(53824, activation='relu'))
model.add(Dense(53824, activation='relu'))
model.add(Dense(53824, activation='relu'))
model.add(Dropout(0.5))
model.add(Dense(1, activation='linear'))

return model
Although building neural network models is admittedly still an art rather than a science, there are some (unwritten) rules, at least for initial approaches to a problem, such as yours here (I guess).

One of them is that dense layers with 50,000 nodes are too large, and AFAIK I have never seen such large layers in practice; multiply this x3 (layers), and no wonder your code takes forever.

I would certainly suggest to experiment with a dense layer size between 100 - 1000, and even start with less than 3 dense layers. Reducing your 1st CNN layer to 32 is also certainly an option.