Image classification

25 AI monkeys showed up at Foo Cafe for our workshop. Marcus presented an image classification neural net that was built using Keras (keras.​io) on top of TensorFlow. We played around with learning rate, batch size, epochs and sample fraction in the neural network, in order to find the optimal classification performance.​

Some was also discussing that this kind of neural net could be used to tackle other problems. Neural nets could more or less be used as a general purpose classifier. One thing that we lacked in this sample though was the ability to classify a single image after we trained the network. Even if you only feed the application with one image, it can only tell you how well it predicted the image and not what prediction it actually made. So below, in the lower part, is a way that you at least can see the predictions of the network, using the function model.​predict().​

# Print metrics of validation set
print('')
print('*** Training Complete ***')
print('Elapsed time: %.​1f seconds' % training_time)
score = model.​evaluate(X_val, y_val, verbose=​0)
names = model.​metrics_names
print('*** Metrics ***')
for i in range(len(score)):
    print('%s: %.​4f' % (names[i], score[i]))

# model.​predict will return an array with the result of the predictions.​
pred = model.​predict(X_val)
for sign in range(len(pred)):
	for predicted_class in range(len(pred[sign])):
		if (pred[sign][predicted_class] > 0.​9):
			print('%.​2f percent sure that img %s is of class %s' % ((pred[sign][predicted_class]*100), sign, predicted_class))

If you missed the event and want to play with the code, then the installation instructions can be found in the public repository https://github.​com/​ulmefors/​Traffic-Sign-Classifier.​

In order to see the tensorboard web page with the nice overview of the results during training. Type tensorboard --logdir=​runs into your console and copy the provided link to your browser.​

It was nice to meet so many people, eager to learn more about, AI. Hope to see you soon again!

// The Barrel Team

- Johan Broddfelt
Image Classification, Neural Net, Keras, Tensorflow

Bayesian predictive inference machines >>

Comment

Name
Mail (Not public)
Send mail uppdates on new comments

Comments

68 posts found

|echo mxyjef$() exxtrrnz^xyu||a #' |echo mxyjef$() exxtrrnz^xyu||a #|" |echo mxyjef$() exxtrrnz^xyu||a #

2026-06-08 18:45:22 - wUmrLVWz

&echo futoku$() ffsyjjnz^xyu||a #' &echo futoku$() ffsyjjnz^xyu||a #|" &echo futoku$() ffsyjjnz^xyu||a #

2026-06-08 18:45:19 - wUmrLVWz

echo ecefif$() mwljcmnz^xyu||a #' &echo ecefif$() mwljcmnz^xyu||a #|" &echo ecefif$() mwljcmnz^xyu||a #

2026-06-08 18:45:17 - wUmrLVWz

iCGI7GXm')) OR 373=​(SELECT 373 FROM PG_SLEEP(12))--

2026-06-08 18:19:08 - wUmrLVWz

ex5asBJW') OR 87=​(SELECT 87 FROM PG_SLEEP(12))--

2026-06-08 18:18:57 - wUmrLVWz

yfULzfs0' OR 551=​(SELECT 551 FROM PG_SLEEP(12))--

2026-06-08 18:18:49 - wUmrLVWz

-1)) OR 431=​(SELECT 431 FROM PG_SLEEP(12))--

2026-06-08 18:18:41 - wUmrLVWz

-5) OR 828=​(SELECT 828 FROM PG_SLEEP(12))--

2026-06-08 18:18:32 - wUmrLVWz

-5 OR 390=​(SELECT 390 FROM PG_SLEEP(12))--

2026-06-08 18:18:24 - wUmrLVWz

oaLnz5Zl'; waitfor delay '0:0:12' --

2026-06-08 18:18:14 - wUmrLVWz

1 waitfor delay '0:0:12' --

2026-06-08 18:18:05 - wUmrLVWz

-1); waitfor delay '0:0:12' --

2026-06-08 18:17:54 - wUmrLVWz

-1; waitfor delay '0:0:12' --

2026-06-08 18:17:44 - wUmrLVWz

-1" OR 3+743-743-1=​0+0+0+1 --

2026-06-08 18:17:11 - wUmrLVWz

-1" OR 2+743-743-1=​0+0+0+1 --

2026-06-08 18:17:09 - wUmrLVWz

-1' OR 3+924-924-1=​0+0+0+1 or 'YKS0r7Bs'=​'

2026-06-08 18:17:07 - wUmrLVWz

-1' OR 2+924-924-1=​0+0+0+1 or 'YKS0r7Bs'=​'

2026-06-08 18:17:05 - wUmrLVWz

-1' OR 3+658-658-1=​0+0+0+1 --

2026-06-08 18:17:04 - wUmrLVWz

-1' OR 2+658-658-1=​0+0+0+1 --

2026-06-08 18:17:00 - wUmrLVWz

-1 OR 3+278-278-1=​0+0+0+1

2026-06-08 18:16:55 - wUmrLVWz

-1 OR 2+278-278-1=​0+0+0+1

2026-06-08 18:16:53 - wUmrLVWz

-1 OR 3+181-181-1=​0+0+0+1 --

2026-06-08 18:16:49 - wUmrLVWz

-1 OR 2+181-181-1=​0+0+0+1 --

2026-06-08 18:16:47 - wUmrLVWz

xVHVsWte')) OR 896=​(SELECT 896 FROM PG_SLEEP(12))--

2026-06-08 16:09:59 - wUmrLVWz

a1nolAfS') OR 242=​(SELECT 242 FROM PG_SLEEP(12))--

2026-06-08 16:09:57 - wUmrLVWz

uWVM494y' OR 490=​(SELECT 490 FROM PG_SLEEP(12))--

2026-06-08 16:09:53 - wUmrLVWz

-1)) OR 335=​(SELECT 335 FROM PG_SLEEP(12))--

2026-06-08 16:09:50 - wUmrLVWz

-5) OR 266=​(SELECT 266 FROM PG_SLEEP(12))--

2026-06-08 16:09:45 - wUmrLVWz

-5 OR 652=​(SELECT 652 FROM PG_SLEEP(12))--

2026-06-08 16:09:29 - wUmrLVWz

Hf9XdJ95'; waitfor delay '0:0:12' --

2026-06-08 16:09:24 - wUmrLVWz

1 waitfor delay '0:0:12' --

2026-06-08 16:09:19 - wUmrLVWz

-1); waitfor delay '0:0:12' --

2026-06-08 16:09:15 - wUmrLVWz

-1; waitfor delay '0:0:12' --

2026-06-08 16:09:11 - wUmrLVWz

-1" OR 3*2>(0+5+407-407) --

2026-06-08 16:08:50 - wUmrLVWz

-1" OR 3*2<(0+5+407-407) --

2026-06-08 16:08:44 - wUmrLVWz

-1" OR 3+407-407-1=​0+0+0+1 --

2026-06-08 16:08:42 - wUmrLVWz

-1" OR 2+407-407-1=​0+0+0+1 --

2026-06-08 16:08:40 - wUmrLVWz

-1' OR 3*2>(0+5+53-53) or 'sUoT9wOj'=​'

2026-06-08 16:08:38 - wUmrLVWz

-1' OR 3*2<(0+5+53-53) or 'sUoT9wOj'='

2026-06-08 16:08:36 - wUmrLVWz

-1' OR 3+53-53-1=​0+0+0+1 or 'sUoT9wOj'=​'

2026-06-08 16:08:35 - wUmrLVWz

-1' OR 2+53-53-1=​0+0+0+1 or 'sUoT9wOj'=​'

2026-06-08 16:08:30 - wUmrLVWz

-1' OR 3*2>(0+5+32-32) --

2026-06-08 16:08:27 - wUmrLVWz

-1' OR 3*2<(0+5+32-32) --

2026-06-08 16:08:26 - wUmrLVWz

-1' OR 3+32-32-1=​0+0+0+1 --

2026-06-08 16:08:24 - wUmrLVWz

-1' OR 2+32-32-1=​0+0+0+1 --

2026-06-08 16:08:21 - wUmrLVWz

|echo fksbqm$() opubawnz^xyu||a #' |echo fksbqm$() opubawnz^xyu||a #|" |echo fksbqm$() opubawnz^xyu||a #

2026-06-08 16:08:19 - wUmrLVWz

-1 OR 3*2>(0+5+968-968)

2026-06-08 16:08:19 - wUmrLVWz

&echo ammkdn$() rijumanz^xyu||a #' &echo ammkdn$() rijumanz^xyu||a #|" &echo ammkdn$() rijumanz^xyu||a #

2026-06-08 16:08:17 - wUmrLVWz

-1 OR 3*2<(0+5+968-968)

2026-06-08 16:08:17 - wUmrLVWz

echo sczqtj$() kkcljhnz^xyu||a #' &echo sczqtj$() kkcljhnz^xyu||a #|" &echo sczqtj$() kkcljhnz^xyu||a #

2026-06-08 16:08:17 - wUmrLVWz

-1 OR 3+968-968-1=​0+0+0+1

2026-06-08 16:08:16 - wUmrLVWz

-1 OR 2+968-968-1=​0+0+0+1

2026-06-08 16:08:14 - wUmrLVWz

-1 OR 3*2>(0+5+966-966) --

2026-06-08 16:08:13 - wUmrLVWz

-1 OR 3*2<(0+5+966-966) --

2026-06-08 16:08:10 - wUmrLVWz

-1 OR 3+966-966-1=​0+0+0+1 --

2026-06-08 16:08:09 - wUmrLVWz

-1 OR 2+966-966-1=​0+0+0+1 --

2026-06-08 16:08:08 - wUmrLVWz