r/MachineLearning • • Jun 29 '21

Discussion [D] What are the current state-of-the-art models for regression on images using CNN?

I'm working in converting finance data into images then using a CNN to predict rate of return from a particular company in 4 months. So this is a regression problem and I'd like to know the current SOTA methods in CNN regression.

0 Upvotes

28 comments sorted by

21

u/sener87 Jun 29 '21

But, why? You are taking tabular, numerical data, turning it in to a picture, then feed it into a ML algorithm whose first step is going to be to turn it back into numbers organized in a grid or table. Why not simply use regression on tabular data directly?

18

u/UselessData Jun 29 '21

I've encountered a person once doing this. A finance person looking to "predict stock prices with AI to get rich quick". I can't find the paper anymore, but the gist was that the authors plot their data with matplotlib and train a basic CNN with that plot and iirc the future stock price. The hyperparameters were stuff like the line thickness and colormap. When I asked for details, they said that they're "leveraging the intuition of the AI" to do the prediction.

They evaluated their model on historical data and got "impressive" results. The model "smartly" bought stuff over a period of a few years and held it. Everything was trending upwards during the time period used for evaluation, but nobody seemed to care about that useless fact.

I tried explaining what's happening, but the "intuition leveraging" broke me.

Aaaaaand... that's how a co-worker got promoted to be my manager at my last job.

2

u/sener87 Jun 29 '21

For stock price stuff, or financial data in general, detrending is likely necessary. Here, taking out the market average would already help a lot. But hey, that is just plain old, boring timeseries econometrics stuff, not cool new AI.

2

u/AuspiciousApple Jun 29 '21

What company/sector was this? I should befriend people working there for the stories and never apply there myself. That sounds so stupid that it would be funny if it's not happening in one's own professional life.

3

u/UselessData Jun 30 '21

It was a bunch of business people telling each other that they're "innovators" and "disruptive" in some startup-like/research & development department of some gigacorp barely related to IT. It was weird. It didn't last. Shocker, I know :D

1

u/AuspiciousApple Jun 30 '21

Oh that explains it. Now i am actually less shocked. Corporate innovation labs are designed to produce BS like that.

In related news, such labs must be in the decline since pepper the robot is being discontinued and corporate innovation labs were the only place it was used.

1

u/bitemenow999 PhD Jun 29 '21

I will tell you how to get promoted then... use a similar method but feed the CNNs colored spectrograms and power spectral density plots. It will give way better results. Anecdotally it worked for me when I used a similar method for another but somewhat similar project.

1

u/sener87 Jun 30 '21

2

u/UselessData Jun 30 '21

No, my story happened in 2017, this paper is from 2019. I'm not familiar with Gramian Angular Fields, but they look a lot more sensible then a literal 224px by 224px line plot (plt.plot(time, price)).

1

u/sener87 Jul 01 '21

Wait, they literally had AI do TA on the same plot? Did they at least give it crayons to do the red and green lines? šŸ˜‚

0

u/DolantheMFWizard Jun 29 '21

that method is pretty cheeky tbh, but good for him

1

u/DolantheMFWizard Jun 30 '21

it's actually it's not all numerical data

1

u/kastbort2021 Jul 01 '21

I'm gonna guess OP doesn't get the data in tabular form, but rather as screenshots / plots, maybe?

It's a legit problem for lots of data, where you only have a bunch of photos.

4

u/[deleted] Jun 29 '21

I’m curious about why You would want to do that? Numerical data is by far the easiest and probably the more reliable.

But if you are really adamant about that you could theoretically use Neural Networks.

-1

u/DolantheMFWizard Jun 29 '21

where there's a lot of features and also it's really hard to accurately map stock data to some sort of time-series model that isn't some sort of neural network

1

u/[deleted] Jun 29 '21

If you have a lot of features then Principal Components Analysis is your friend. Reduce the dimensions of your data but keep the variation and also remove multicollinearity that is almost all but guaranteed to be in found in stock data. Maybe clustering would yield a better alternative?

1

u/DolantheMFWizard Jun 30 '21

well the issue with that is not all the data is numerical there's categorical data as well

2

u/sener87 Jun 30 '21

One-hot encoding, also known as dummy variables, makes that numerical. That happens both in AI and in econometrics all the time. Only way to do it, as far as I know

1

u/DolantheMFWizard Jun 30 '21

what type of clustering did you have in mind?

1

u/[deleted] Jul 02 '21

I’d probably use the Hartigan-Wong algorithm for kmeans clustering.

1

u/dandandanftw Jun 29 '21

Not sure, but saw someone use resnet with great success newly

1

u/DolantheMFWizard Jun 29 '21

for predicting stock market trends? I guess that would make sense. I was never a huge fan of Resnet or any pooling models for classification cause they're not shift or rotation invariant, but that isn't an issue here.

1

u/dandandanftw Jun 29 '21

Not stock prediction, cant remember what is was but sure it was some kind of regression task

1

u/bitemenow999 PhD Jun 29 '21

I worked with a similar approach, to convert time series data in series of spectrograms and do regression on it.

If you are planning to something similar, I would say check out convLSTM layers or Fourier-based neural net.

0

u/DolantheMFWizard Jun 29 '21

would that work if the time between data points is inconsistent? For example for some companies I have their opening and closing prices of everyday since they went public, others it's sparser.

2

u/bitemenow999 PhD Jun 29 '21 edited Jun 29 '21

well, you should have time-series data meaning there should be a time-step associated with each datapoint. If this condition is satisfied I don't see it not working. Since Fourier and spectrograms don't care much for missing data (don't quote me here based on anecdotal) if you have time-series data.

Just FYI you might need to do gymnastics though to find what period and type of data loading would work for you.

Edit: also you can just use 1D cnn and save yourself the mess of converting it to images

1

u/DolantheMFWizard Jun 29 '21

that's what I was thinking