Discussion
Started 6th Apr, 2022

What is the largest number of hidden layers that can be added to deep learning networks?

How do we determine the appropriate number of hidden layers for the problem so that it positively affects the solution of the desired problem?
How do we understand the impact of adding an additional hidden layer on improving workflow? Where exactly will the improvement be?

Most recent answer

19th Jul, 2022
Hangcheng Dong
Harbin Institute of Technology
For complex networks it is currently difficult to analyze, but for shallow interpretable networks this problem can be addressed, which can be referred to in my article “Training neural networks for solving 1-D optimal piecewise linear approximation”

All replies (22)

6th Apr, 2022
Ehtisham Lodhi
Chinese Academy of Sciences
As far as I can imagine, it might be difficult to judge the maximum number of layers for a task without a proper ablation study. If the data is linearly separable then you don't need any hidden layers at all. If data is less complex and is having fewer dimensions or features then neural networks with 1 to 2 hidden layers would work. If data is having large dimensions or features then to get an optimum solution, 3 to 5 hidden layers can be used. It should be kept in mind that increasing hidden layers would also increase the complexity of the model and choosing hidden layers such as 8, 9, or in two digits may sometimes lead to overfitting. Please have a look at these links for further information:
Regards;
Ehtisham
1 Recommendation
6th Apr, 2022
Qamar Ul Islam
Universiti Sains Malaysia
6th Apr, 2022
Najla Matti Isaacc
University of Mosul
Thank you, Dr. Ehtisham Lodhi, for your answer
6th Apr, 2022
Ali Khalili
University of Tehran
Hello,
You only have hardware limitations and theoretically, if you do not consider the practicality or the problems that arise with the increase of model layers(Vanishing gradients, etc.), you can go as deep as you want in your hidden layers.
1 Recommendation
6th Apr, 2022
Najla Matti Isaacc
University of Mosul
Thank you, Dr. Qamar Ul Islam , for your contribution.
1 Recommendation
6th Apr, 2022
Najla Matti Isaacc
University of Mosul
Ali Khalili Thank you, for your contribution.
6th Apr, 2022
Shima Shafiee
Razi University
Earlier versions of neural networks such as the first perceptrons were shallow, composed of one input and one output layer, and at most one hidden layer in between. More than three layers (including input and output) qualify as “deep” learning.
  1. The number of hidden neurons should be between the size of the input layer and the size of the output layer.
  2. The number of hidden neurons should be 2/3 the size of the input layer, plus the size of the output layer.
  3. The number of hidden neurons should be less than twice the size of the input layer.
A hidden layer in an artificial neural network is a layer in between input layers and output layers, where artificial neurons take in a set of weighted inputs and produce an output through an activation function.
1 Recommendation
7th Apr, 2022
Qamar Ul Islam
Universiti Sains Malaysia
your welcome Dr. Najla Matti Isaacc Ramadan Kareem Mubarak. Stay Happy Stay Healthy.
1 Recommendation
7th Apr, 2022
Muhammad Aitsam
Sheffield Hallam University
There is no specific number though. It depends on the following points:
1) your application
2) hardware capacity
To know more about hidden layers:
7th Apr, 2022
Ritu Aggarwal
Maharishi Markandeshwar University, Mullana
Efficient net
7th Apr, 2022
Najla Matti Isaacc
University of Mosul
Thank you so much Dr. Qamar Ul Islam
You too, God willing
regards.
7th Apr, 2022
Najla Matti Isaacc
University of Mosul
Thank you very much Shima Shafiee for your answer
.
7th Apr, 2022
Najla Matti Isaacc
University of Mosul
7th Apr, 2022
Najla Matti Isaacc
University of Mosul
Thanks a lot , Dr. Muhammad Aitsam , for your contribution.
Hi Najla,
Thanks for the questions.
My response to your three questions at this point:
"It depends."
Cheers,
Bill
p.s. To those who may think mine is a non-response, I have learned over time that before announcing "I got it," one needs to know more about each circumstance intended by the questions, in the mind of the person asking.
1 Recommendation
7th Apr, 2022
Ravishankar Jaiswal
Central Drug Research Institute
It's depends on your working application and hardware resources. In mostly , traditional artificial neural network have one to three hidden later for simple task use(shallow network ), but compromise with performance and other hand more deeper and depth network (i.e. CNN architectures) has more parameters that gives better performance than traditional. So, it's depends on what you want to do and what you wanted to get result. Hidden layer play important role to learning important feature and they extract feature to give output. So, you should keep in mind what types of data input you using and how many training sample instances you have. They impact your network overall out performance bcz more complexity means more hidden layer and they turning to overfit the model and if you have less layers as simple like you face the underfitting problem. I think you play with your hidden layer and check the performance of trained model.
8th Apr, 2022
Ritu Aggarwal
Maharishi Markandeshwar University, Mullana
It's depends on application you used
9th Apr, 2022
Talib Iqball
University of Kashmir
It depends on the distribution of training data. If the distribution of your data is complex, that means it has lot of information and learning the non-linearity function to separate the classes is hard.
In that case you can have proportionally complex network having more number of layers to learn from the information within the data.
10th Apr, 2022
Maryam Rahimzad
Institut National de la Recherche Scientifique
Dear Najla,
In my opinion, you should first consider some relevant papers as your benchmark models and try to develop and improve their performance because building a deep model from scratch is quite hard due to the different hyperparameters that you should set on your own.
There is a tool called "Keras Tuner" that you can use to leverage different numbers of hidden layers and their impact on the training procedure.
In general, the number of hidden layers depends on the amount of training data that you have and the complexity of your problem. So I think the related published papers can guide you in this regard.
I hope to find it useful
19th Apr, 2022
Adebisi Ademusire
Obafemi Awolowo University
No one can be specific about that because it depends on the steps you break your algorithm down to . I mean the complexity. You might want to handle each of the steps with different hidden layers
3rd May, 2022
Ritu Aggarwal
Maharishi Markandeshwar University, Mullana
It depends which type of learning used . Such as alexnet lfnet etc..
19th Jul, 2022
Hangcheng Dong
Harbin Institute of Technology
For complex networks it is currently difficult to analyze, but for shallow interpretable networks this problem can be addressed, which can be referred to in my article “Training neural networks for solving 1-D optimal piecewise linear approximation”

Similar questions and discussions

Related Publications

Got a technical question?
Get high-quality answers from experts.