Neural network inputs and targets

In summary, you can use the train function in MATLAB to train a neural network model, and then use the sim function to test the network with new data and recognize different letters.
  • #1
roldy
237
2
I've written a program for character recognition but now upon testing I am unsure about a couple things. I'm having problems with training and simulating the network. Here is my interpretation of how network training goes.

Suppose I want to recognize the letters in the ABCD image attached. In MATLAB I used the function

Code:
[net,tr] = train(net,inputs,targets);

To train I set inputs = targets, where targets is the image with "ABCD". Then to recognize, say the letter D, I use this function

Code:
sim(net,input);

where input = the letter "D".

All this is done after appropriate image processing where I convert the images to binary matrices where each row describes a letter.

Is my understanding in how MATLAB trains correct? I want to be able to train once for all the letters, then have the user select any image (each image contains either only a "A", "B", "C", "D") and submit it to the network and notify the user if there is a match.
 

Attachments

  • ABCD.bmp
    21.5 KB · Views: 562
  • D.bmp
    5.6 KB · Views: 599
Last edited:
Technology news on Phys.org
  • #2
Yes, your understanding is correct. The train function is used to create a neural network model by fitting a set of training data (inputs and targets). Once the network is trained, you can use the sim function to test the network with new data (inputs) and see how it performs. To recognize different letters, you need to create separate input matrices for each letter. Then, when you submit an image to the network, you can compare the output of the sim function with the inputs you used to train the network and determine which letter is present in the image.
 

1. What are neural network inputs and targets?

Neural network inputs refer to the data that is fed into a neural network for processing, such as images, text, or numerical data. Targets, also known as labels, are the desired outputs for a given set of inputs. They represent the correct answers or classifications for the input data.

2. How are neural network inputs and targets chosen?

The selection of neural network inputs and targets depends on the specific problem that the neural network is trying to solve. Inputs should be relevant to the problem and have a significant impact on the desired output. Targets should accurately represent the desired outcome for the given inputs.

3. Can neural network inputs and targets be preprocessed?

Yes, neural network inputs and targets can be preprocessed to improve the performance of the network. This can include techniques such as normalization, scaling, or feature extraction. Preprocessing can help the network to better understand the data and make more accurate predictions.

4. How many inputs and targets should a neural network have?

The number of inputs and targets for a neural network depends on the complexity of the problem. Generally, more inputs and targets allow for a more accurate and detailed representation of the problem, but also require a larger and more complex network. It is important to find a balance between the number of inputs and targets for optimal performance.

5. Can neural network inputs and targets change over time?

Yes, in some cases, neural network inputs and targets can change over time. For example, in a predictive model, the inputs may change as new data becomes available. In this case, the network may need to be retrained to adapt to the new inputs and targets. In other cases, the inputs and targets may remain constant, such as in image recognition tasks where the same set of images is used for training and testing.

Similar threads

  • Programming and Computer Science
Replies
18
Views
1K
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
1
Views
926
  • Programming and Computer Science
Replies
3
Views
997
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
2
Views
916
  • Computing and Technology
Replies
4
Views
1K
  • Programming and Computer Science
Replies
3
Views
890
  • Programming and Computer Science
Replies
1
Views
1K
Replies
1
Views
1K
Back
Top