<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Keras_Image_Classification</id>
	<title>Keras Image Classification - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Keras_Image_Classification"/>
	<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=Keras_Image_Classification&amp;action=history"/>
	<updated>2026-04-04T06:51:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>https://onnocenter.or.id/wiki/index.php?title=Keras_Image_Classification&amp;diff=72719&amp;oldid=prev</id>
		<title>Onnowpurbo at 13:00, 24 June 2025</title>
		<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=Keras_Image_Classification&amp;diff=72719&amp;oldid=prev"/>
		<updated>2025-06-24T13:00:49Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:00, 24 June 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l56&quot; &gt;Line 56:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 56:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  image_index = 100&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  image_index = 100&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  plt.imshow(x_test[image_index].reshape(28, 28),cmap='Greys')&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  plt.imshow(x_test[image_index].reshape(28, 28),cmap='Greys')&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  pred = model.predict(x_test[image_index].reshape(1, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;img_rows&lt;/del&gt;, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;img_cols&lt;/del&gt;, 1))&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  pred = model.predict(x_test[image_index].reshape(1, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;28&lt;/ins&gt;, &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;28&lt;/ins&gt;, 1))&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  print(pred.argmax())&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  print(pred.argmax())&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
	<entry>
		<id>https://onnocenter.or.id/wiki/index.php?title=Keras_Image_Classification&amp;diff=56669&amp;oldid=prev</id>
		<title>Onnowpurbo: Created page with &quot; #!/usr/bin/env python2  # -*- coding: utf-8 -*-  &quot;&quot;&quot;  Created on Sat Aug 10 07:51:56 2019    https://towardsdatascience.com/image-classification-in-10-minutes-with-mnist-data...&quot;</title>
		<link rel="alternate" type="text/html" href="https://onnocenter.or.id/wiki/index.php?title=Keras_Image_Classification&amp;diff=56669&amp;oldid=prev"/>
		<updated>2019-08-10T01:08:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; #!/usr/bin/env python2  # -*- coding: utf-8 -*-  &amp;quot;&amp;quot;&amp;quot;  Created on Sat Aug 10 07:51:56 2019    https://towardsdatascience.com/image-classification-in-10-minutes-with-mnist-data...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt; #!/usr/bin/env python2&lt;br /&gt;
 # -*- coding: utf-8 -*-&lt;br /&gt;
 &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
 Created on Sat Aug 10 07:51:56 2019&lt;br /&gt;
 &lt;br /&gt;
 https://towardsdatascience.com/image-classification-in-10-minutes-with-mnist-dataset-54c35b77a38d&lt;br /&gt;
 &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 import tensorflow as tf&lt;br /&gt;
 (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() &lt;br /&gt;
 &lt;br /&gt;
 # &lt;br /&gt;
 import matplotlib.pyplot as plt&lt;br /&gt;
 image_index = 7777 # You may select anything up to 60,000&lt;br /&gt;
 print(y_train[image_index]) # The label is 8&lt;br /&gt;
 plt.imshow(x_train[image_index], cmap='Greys') &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 x_train.shape&lt;br /&gt;
&lt;br /&gt;
 # Reshaping the array to 4-dims so that it can work with the Keras API&lt;br /&gt;
 x_train = x_train.reshape(x_train.shape[0], 28, 28, 1)&lt;br /&gt;
 x_test = x_test.reshape(x_test.shape[0], 28, 28, 1)&lt;br /&gt;
 input_shape = (28, 28, 1)&lt;br /&gt;
 # Making sure that the values are float so that we can get decimal points after division&lt;br /&gt;
 x_train = x_train.astype('float32')&lt;br /&gt;
 x_test = x_test.astype('float32')&lt;br /&gt;
 # Normalizing the RGB codes by dividing it to the max RGB value.&lt;br /&gt;
 x_train /= 255&lt;br /&gt;
 x_test /= 255&lt;br /&gt;
 print('x_train shape:', x_train.shape)&lt;br /&gt;
 print('Number of images in x_train', x_train.shape[0])&lt;br /&gt;
 print('Number of images in x_test', x_test.shape[0])&lt;br /&gt;
&lt;br /&gt;
 # Importing the required Keras modules containing model and layers&lt;br /&gt;
 from keras.models import Sequential&lt;br /&gt;
 from keras.layers import Dense, Conv2D, Dropout, Flatten, MaxPooling2D&lt;br /&gt;
 # Creating a Sequential Model and adding the layers&lt;br /&gt;
 model = Sequential()&lt;br /&gt;
 model.add(Conv2D(28, kernel_size=(3,3), input_shape=input_shape))&lt;br /&gt;
 model.add(MaxPooling2D(pool_size=(2, 2)))&lt;br /&gt;
 model.add(Flatten()) # Flattening the 2D arrays for fully connected layers&lt;br /&gt;
 model.add(Dense(128, activation=tf.nn.relu))&lt;br /&gt;
 model.add(Dropout(0.2))&lt;br /&gt;
 model.add(Dense(10,activation=tf.nn.softmax))&lt;br /&gt;
&lt;br /&gt;
 model.compile(optimizer='adam', &lt;br /&gt;
               loss='sparse_categorical_crossentropy', &lt;br /&gt;
               metrics=['accuracy'])&lt;br /&gt;
 model.fit(x=x_train,y=y_train, epochs=10)&lt;br /&gt;
&lt;br /&gt;
 # test / evaluate model&lt;br /&gt;
 model.evaluate(x_test, y_test)&lt;br /&gt;
&lt;br /&gt;
 # test image classification&lt;br /&gt;
 image_index = 100&lt;br /&gt;
 plt.imshow(x_test[image_index].reshape(28, 28),cmap='Greys')&lt;br /&gt;
 pred = model.predict(x_test[image_index].reshape(1, img_rows, img_cols, 1))&lt;br /&gt;
 print(pred.argmax())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Pranala Menarik==&lt;br /&gt;
&lt;br /&gt;
* [[Keras]]&lt;/div&gt;</summary>
		<author><name>Onnowpurbo</name></author>
	</entry>
</feed>