我在训练用于图像分类的神经网络时遇到问题。基于 NN 的性能,它似乎没有在学习。
我基本上在 encog-examples (ImageNeuralNetwork) 中运行给定的程序来对一组图像进行分类。以下是示例程序输出
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
...<more files here>...
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
如您所见,NN 从接近 200% 的误差波动到接近 100% 的误差。首先,我什至不确定是否可能出现超过 100% 的错误,更不用说 200%。
下面是我的输入文件,其中包含 NN 的命令和参数:
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
<more files...>
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
<more files...>
我最初的猜测是,实际图像或理想值都没有正确地馈送到 NN,但我检查了输入(例如,输出我读过的图像和理想值),它们没问题。
现在我的预感是某些目录(可能是 java 库或读取输入文件的位置)没有正确设置。下面是我的 Eclipse 运行配置:
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
顺便说一句,我也不能正确运行 Forest Cover 示例(需要输入文件),而我可以运行 Lunar Lander 和 XOR 示例(不需要输入文件)。这加强了我的假设,即我的问题与目录有关。
任何帮助深表感谢。谢谢。