php ml - PHP ImageClassifier was trained with an image and when tested to classified it again I get an opposite result?

one text

I am using this github repo which is using php-ai repo. I have a very simple code to classify images after I have made 2 folders which are called good and bad images and then I run this:

$classifierNew = new ImageClassifier(true);
$classifierNew->train();

I train the AI with 20 good and 20 bad images. After I train the AI I test it with the same images in order to see if I got the right result and from the total of 40 images I got 17 mistakes which the AI thinks it is good but it is in the bad folder when it was trained. Can someone tell me what I am doing wrong and how can I improve the code/logic? Thanks.

Source