#Basic CNN Model Help

1 messages · Page 1 of 1 (latest)

fast bolt
#

Hi I am very new to AI. I am doing a project in PyTorch and I am trying to build a CNN that takes ECG signals and outputs 0 or 1 to denote healthy or unhealthy. I am extremely inexperienced when it comes to input, hidden, and output dimensions while building the model as this is my first AI project ever. I am getting many shape mismatches and don't know to fix them. I can't find too much information online that explains Convolution layers that well in detail. Can someone maybe help me if I post code and give you knowledge on my data? Would really appreciate it. I am trying to build this model by Thursday morning, so any help would mean a lot.

proper bluff
#

You want to classify Electrocatiography data into healty or unhealty by using images? Wouldnt it much better to directly use the values itself? i mean its basicly just measurements over time, an image would not be the best format for this type of data i guess?

Anyways, back to your Question, you can simply use the model described in the example of tensorflow itself:
https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html
There in section 2 you got an example code for the "Net" simply change the last layer (fc3) to self.fc3 = nn.Linear(84, 2) to change the outputvalues to 2 classes (healty and unhealthy).
The only problem you will face (or maybe you face currently, not sure where your "mismatch" problem is) is the image size, for the first approach you can simply scale your images to the shape of 32x32 pixels, then everything should work.
If this works, you can continue editing to use the images in complete size, then add more layers to it, then adjust hyperparameters and add preprocessing/transformation to your data.
By doing this you will increase complexity step by step and learn the basics. By doing all step at once, you will face many issues, wich could be overwhelming;)

Hope this helps, good luck and enjoy your project 👍

fast bolt
#

Haha no I am using the signals actually

#

It’s not images. My training data shape is (8000,250) where 250 is signals and the labels are (8000,1) where 1 is a 0 or 1 denoting healthy or unhealthy

jagged patrol
#

I had a similar assingment at the university I recently graduated from. Here is an example of a web resource that can help. Probably it's similar to what you have to solvehttps://machinelearningmastery.com/how-to-develop-convolutional-neural-network-models-for-time-series-forecasting/, because an electrocardiogram is given just as it is: Raw numbers that form a signal. You can ask me for details. The link gives example in Keras, and I did it using Pytorch

Convolutional Neural Network models, or CNNs for short, can be applied to time series forecasting. There are many types of CNN models that can be used for each specific type of time series forecasting problem. In this tutorial, you will discover how to develop a suite of CNN models for a range of standard time […]

#

Sorry for being this late, but somebody else needed help with a NLP project

fast bolt
#

Hi @jagged patrol do you think I could text u privately? In the meantime I will look at the links you sent. Thank you so much for replying to me

jagged patrol
#

Sure, let's hope it's still not too late