# Is it possible that MLP has better accuracy than CNN?

I am working on the epilepsy classification system which consumes EEG signals and in the result says if withing the certain period is a seizure or not. I take an advantage of Keras API for the sake of network training. I am giving a try at a few different neural network configurations and now I wonder is it possible that MLP is better than CNN in 1D classification in some cases? My question is not only related to EEG or epilepsy detection, but more if there is any example when MLP behaves better than CNN in the sense of accuracy. Or maybe it is mathematically proven that there is always some CNN which will beat MLP for the given classification problem.

For CNN I use keras.layers.Conv1D, for MLP keras.layers.Dense if that matters.

Yes, it's possible that an MLP has better accuracy than a CNN.

Here's one discussion

CNN (and RNN) models are not general improvements to the MLP design. They are specific choices that match certain types of problem. The CNN design works best when there is some local pattern in the data (which may repeat in other locations), and this is often the case when the inputs are images, audio or other similar signals.

You say:

Or maybe it is mathematically proven that there is always some CNN which will beat MLP for the given classification problem.

which is an interesting question. MLP's and CNN's are actually "equivalent" in the sense that if you have an MLP, I can write down a CNN that is identical to it (produces the same output), and vice versa. See discussions here and here.

All this is to say, it's not "CNN vs MLP" that matters as much as the details of the architecture / optimization / etc. The first answer I linked to explains why typical CNN architectures work well. The phrase "some local pattern in the data (which may repeat in other locations)" is a way of saying there is some translation equivariance in the data. If there is not translation equivariance, an MLP might work better.