title: Encog Neural Network for Classifying Images : Training
body: <p>I'm having problem training a neural network for image classification. Basing it on the performance of the NN, it doesn't seem to be learning.</p>
  
  <p>I basically run the given program in encog-examples (ImageNeuralNetwork) to classify a set of images. The following is the sample program output</p>
  
  <pre><code>Training set created
  Added input image:./faces/at33_straight_neutral_open.png; identity: shadesNone
  Added input image:./faces/night/night_up_happy_sunglasses_4.png; identity: shades
  ...&lt;more files here&gt;...
  Added input image:./faces/cheyer/cheyer_up_neutral_open_4.png; identity: shadesNone
  Downsampling images...
  Created network: [BasicNetwork: Layers=3]
  Training Beginning... Output patterns=2
  Beginning training...
  Iteration #1 Error:199.591952% elapsed time = 00:00:00 time left = 00:01:00
  Iteration #2 Error:196.384178% elapsed time = 00:00:00 time left = 00:01:00
  Iteration #3 Error:160.422574% elapsed time = 00:00:00 time left = 00:01:00
  ...
  Iteration #16 Error:99.733657% elapsed time = 00:00:00 time left = 00:01:00
  ...
  Iteration #202 Error:99.489796% elapsed time = 00:00:04 time left = 00:01:00
  ...
  Iteration #203 Error:199.605091% elapsed time = 00:00:04 time left = 00:01:00
  </code></pre>
  
  <p>As you can see, the NN oscillates from error close to 200% then to error close to 100%. 
  In the first place, I'm not even sure if an error above 100% is possible, much less 200%.</p>
  
  <p>Below is my input file containing the commands and parameters to the NN :</p>
  
  <pre><code>CreateTraining: width:16,height:15,type:Brightness
  Input: image:./faces/at33_straight_neutral_open.png, identity:shadesNone
  Input: image:./faces/night/night_up_happy_sunglasses_4.png, identity:shades
  Input: image:./faces/choon/choon_up_angry_open_4.png, identity:shadesNone
  Input: image:./faces/cheyer/cheyer_left_angry_sunglasses_4.png, identity:shades
  &lt;more files...&gt;
  Network: hidden1:10, hidden2:10
  Train: Mode:console, Minutes:1, StrategyError:0.25, StrategyCycles:100 
  Whatis: image:./faces/tammo/tammo_right_sad_sunglasses_4.png
  &lt;more files...&gt;
  </code></pre>
  
  <p>My initial guess was that either the actual images or the ideal values were not properly fed to the NN, but I checked the inputs (e.g. outputting the images and ideal values that I have read), and they were  ok.  </p>
  
  <p>Now my hunch is that some directories (perhaps of the java library or where the input files are read) are not properly set. Below is my Eclipse Run Configuration:</p>
  
  <pre><code>  Classpath Tab
      Bootstrap Entries
        JRE System Library [jre7]
      User Entries
          encog-examples (default classpath)
            encog-examples
            encog-core-3.2.0-SNAPSHOT.jar \encog-examples\lib
  </code></pre>
  
  <p>Incidentally, I can't also properly run the Forest Cover example (which require an input file), while I can run the Lunar Lander and XOR examples (which don't require input files). This strengthens my assumption that my problem is directory-related.</p>
  
  <p>Any help is much appreciated. Thanks.</p>