BP Neural Network
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi, I want to implement some custom BP Neural Networks with MATLAB! I have an aging database that contains face features (68 pairs of face points), gender and age. so I have a [1002x138] matrix as input datas for NN. 1002 face features and 138 value for each face...
face features must classify to 4 groups of ages [1-12,13-25,26-45,46-63] by NN.
Back-propagation network features : 136(68x2) Input values, 2 hidden layers, 4 output values (boolean type).
To achieve my target, I need to construct five NNs. The first NN is the main neural network. The main NN is concern with the main age classification with four outputs as I mentioned before. The other four NNs are concern with secondary age classification. Each neural network (the five networks) has 68 pairs of inputs representing the face features in addition to the gender of the person. It is also to be noted that we need two hidden layers, one hidden layer is to correlate each pair in one meaningful unit and the second is consider to be the real hidden layer after organizing the input data in the first hidden layer. The gender is connected directly to the second hidden layer. The number of outputs for each NN related to secondary classification is two representing the more specific age range in its domain.
I did read this article : (<http://web.eecs.umich.edu/~someshs/nn/matlab_nn_starter.htm>) but finally I've never been success in nnetwork creation.
It's my network definition :
net =network;
net.numInputs=138;
for i=1:136
net.inputs{i}.size = 1;
end
net.numLayers = 3;
net.layers{1}.size = 69;
net.layers{2}.size = 69;
net.layers{3}.size = 4;
net.inputConnect(1) = 1;
net.layerConnect(2, 1) = 1;
net.layerConnect(3, 2) = 1;
net.outputConnect(3) = 1;
net.targetConnect(3) = 1;
net.layers{1}.transferFcn = 'logsig';
net.layers{2}.transferFcn = 'purelin';
net.layers{3}.transferFcn = 'purelin';
net.biasConnect(1) = 1;
net.biasConnect(2) = 1; %how can I connect this bias to gender?
net.biasConnect(3) = 1;
net.initFcn = 'initlay';
net = init(net);
net.performFcn = 'mse';
net.trainFcn = 'trainlm';
I want to know how can I define, connect, train and test these networks using matlab?
Thanks guys.
댓글 수: 3
Greg Heath
2012년 4월 18일
Have you considered k-means clustering, using a radial basis function net or using a LVQ net? These aproaches tend to allow a better visualization and understanding of the class division.
Hope this helps.
Greg
채택된 답변
Greg Heath
2012년 4월 19일
If the net
1. MUST be a 2-hidden-layer FFMLP
2. MUST use the 1st hidden layer to recognizably separate the 4 classes
3. MUST be trained via BackProp
Try versions of the following:
1. For each class, design a 136-1-1 two-class classifier using patternnet(1). Since the initial weights are random, design many ( 10 each?) and choose the best.
2. Use the weights of the 4 selected classifiers for the first layer weights of a 136-4-4 four-class classifier using patternnet([4 H]).
3. Choose a good value for H by trial and error.
4. If you cannot freeze the 1st layer weights with learning rates of zero, store the hidden layer outputs of the two-class classifiers to train the last two layers of the four-class classifier.
Hope this helps.
Greg
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!