{"id":53934,"date":"2025-09-25T10:41:58","date_gmt":"2025-09-25T00:41:58","guid":{"rendered":"https:\/\/www.cloudproinc.com.au\/?p=53934"},"modified":"2025-09-25T10:42:00","modified_gmt":"2025-09-25T00:42:00","slug":"build-a-keras-model-for-real-projects","status":"publish","type":"post","link":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/","title":{"rendered":"Build a Keras Model for Real Projects"},"content":{"rendered":"\n<p>In this blog post Build a Keras Model for Real Projects From Idea to Deployment we will walk through a practical, end-to-end way to design, train, and ship a Keras model that stands up in real work.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/category\/keras\/\">Keras <\/a>is a high-level deep learning API that runs on top of TensorFlow. It abstracts the heavy lifting\u2014tensor math, automatic differentiation, and GPU acceleration\u2014so you can focus on model architecture and data. Under the hood, TensorFlow builds a computational graph of layers and operations. During training, backpropagation adjusts the model\u2019s parameters by computing gradients of a loss function and applying an optimizer like Adam. The result: concise code, strong performance, and production-grade tooling.<\/p>\n\n\n\n<p>In Build a Keras Model for Real Projects From Idea to Deployment we\u2019ll start with a clear, non-jargony overview of what matters, then move into code. We\u2019ll cover data handling, architecture choices, training, evaluation, and deployment options\u2014plus the small details that make a big difference when projects leave the notebook and head to production.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-you-ll-build-and-why-keras\">What you\u2019ll build and why Keras<\/h2>\n\n\n\n<p>We\u2019ll build a simple but real image classifier on the MNIST dataset to keep the code short and readable. The same pattern applies to tabular, text, or time series problems\u2014you\u2019ll swap the input pipeline and layers, but the workflow stays consistent.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keras keeps code compact and readable<\/li>\n\n\n\n<li>TensorFlow provides performance, distribution strategies, and serving<\/li>\n\n\n\n<li>Callbacks, metrics, and standardized saving make production easier<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-set-up-and-plan\">Set up and plan<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-environment\">Environment<\/h3>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-6dfda78256acaf1fd1924fea99b40cb9\"><code># Install (CPU). For GPU, install tensorflow with appropriate CUDA\/CuDNN.\npip install tensorflow\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-633415244c231c9cef37ad550bad8f91\"><code>import os, random\nimport numpy as np\nimport tensorflow as tf\n\n# Reproducibility (helps debugging and comparisons)\nSEED = 42\nrandom.seed(SEED)\nnp.random.seed(SEED)\ntf.random.set_seed(SEED)\nprint(tf.__version__)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-define-the-objective-and-metric\">Define the objective and metric<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Objective: classify handwritten digits<\/li>\n\n\n\n<li>Primary metric: accuracy<\/li>\n\n\n\n<li>Secondary metric: validation loss (for early stopping)<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-load-and-prepare-data\">Load and prepare data<\/h2>\n\n\n\n<p>We\u2019ll use MNIST for clarity. In production, expect to spend more time here than anywhere else.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-95a4ec0e571bfbf90c232ab3bdb7ba37\"><code>from tensorflow import keras\n\n# Load data\n(x_train, y_train), (x_test, y_test) = keras.datasets.mnist.load_data()\n\n# Hold out a validation set from the training data\nval_size = 10_000\nx_val, y_val = x_train&#91;-val_size:], y_train&#91;-val_size:]\nx_train, y_train = x_train&#91;:-val_size], y_train&#91;:-val_size]\n\n# Normalize and add channel dimension\nx_train = (x_train&#91;..., np.newaxis] \/ 255.).astype(\"float32\")\nx_val   = (x_val&#91;...,   np.newaxis] \/ 255.).astype(\"float32\")\nx_test  = (x_test&#91;...,  np.newaxis] \/ 255.).astype(\"float32\")\n\n# Build performant tf.data pipelines\nBATCH = 128\ntrain_ds = (tf.data.Dataset.from_tensor_slices((x_train, y_train))\n            .shuffle(10_000, seed=SEED)\n            .batch(BATCH)\n            .prefetch(tf.data.AUTOTUNE))\nval_ds   = (tf.data.Dataset.from_tensor_slices((x_val, y_val))\n            .batch(BATCH)\n            .prefetch(tf.data.AUTOTUNE))\ntest_ds  = (tf.data.Dataset.from_tensor_slices((x_test, y_test))\n            .batch(BATCH)\n            .prefetch(tf.data.AUTOTUNE))\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-build-the-keras-model\">Build the Keras model<\/h2>\n\n\n\n<p>You can use the Sequential API for straightforward stacks, or the Functional API for more complex graphs (multiple inputs\/outputs, skip connections). Let\u2019s start with Sequential.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-a0d99cef5c3bb05619f1b9cacc583353\"><code>from tensorflow.keras import layers, models\n\nmodel = models.Sequential(&#91;\n    layers.Input(shape=(28, 28, 1)),\n    layers.Conv2D(32, 3, activation=\"relu\"),\n    layers.Conv2D(64, 3, activation=\"relu\"),\n    layers.MaxPooling2D(),\n    layers.Dropout(0.25),\n    layers.Flatten(),\n    layers.Dense(128, activation=\"relu\"),\n    layers.Dropout(0.5),\n    layers.Dense(10, activation=\"softmax\")\n])\n\nmodel.summary()\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-compile-with-loss-optimizer-and-metrics\">Compile with loss, optimizer, and metrics<\/h3>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-f9973d0b3e56fa905fe7de04c4a907dd\"><code>model.compile(\n    optimizer=keras.optimizers.Adam(learning_rate=1e-3),\n    loss=keras.losses.SparseCategoricalCrossentropy(),\n    metrics=&#91;\"accuracy\"]\n)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-train-with-callbacks\">Train with callbacks<\/h3>\n\n\n\n<p>Callbacks automate good hygiene\u2014stop early when performance plateaus, lower the learning rate, and keep the best weights.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-b64471c9d855f4f093b03d449df27e19\"><code>callbacks = &#91;\n    keras.callbacks.EarlyStopping(monitor=\"val_loss\", patience=3, restore_best_weights=True),\n    keras.callbacks.ReduceLROnPlateau(monitor=\"val_loss\", factor=0.5, patience=2),\n    keras.callbacks.ModelCheckpoint(\"mnist_cnn.keras\", save_best_only=True)\n]\n\nhistory = model.fit(\n    train_ds,\n    validation_data=val_ds,\n    epochs=20,\n    callbacks=callbacks\n)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-evaluate-and-predict\">Evaluate and predict<\/h2>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-1eab0464c0d4dcdf305bff6171541637\"><code>test_loss, test_acc = model.evaluate(test_ds)\nprint({\"test_loss\": float(test_loss), \"test_acc\": float(test_acc)})\n\n# Predict a single sample\nsample = x_test&#91;:1]\np = model.predict(sample)\nprint(\"Predicted class:\", int(np.argmax(p, axis=1)&#91;0]))\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-save-and-deploy\">Save and deploy<\/h2>\n\n\n\n<p>You have two common options: the native Keras format for portability, or TensorFlow SavedModel for serving. Use what your deployment target expects.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-d54f34b9afb5bc3643a16af7d568485f\"><code># Save in native Keras format (recommended for Keras 3 and most workflows)\nmodel.save(\"mnist_cnn.keras\")\nreloaded = keras.models.load_model(\"mnist_cnn.keras\")\n\n# Save as TensorFlow SavedModel (useful for TF Serving)\nkeras.models.save_model(model, \"export\/mnist_savedmodel\")\n\n# Optional: Convert to TensorFlow Lite for mobile\/edge\nconverter = tf.lite.TFLiteConverter.from_saved_model(\"export\/mnist_savedmodel\")\ntflite_model = converter.convert()\nwith open(\"mnist.tflite\", \"wb\") as f:\n    f.write(tflite_model)\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-when-to-use-the-functional-api\">When to use the Functional API<\/h2>\n\n\n\n<p>For non-linear topologies, multiple inputs, or custom heads, switch to Functional. It is equally concise and far more flexible.<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-e6877ce03904b5f116f84b08bcbab5f8\"><code>inputs = keras.Input(shape=(28, 28, 1))\nx = layers.Conv2D(32, 3, activation=\"relu\")(inputs)\nx = layers.Conv2D(64, 3, activation=\"relu\")(x)\nx = layers.MaxPooling2D()(x)\nx = layers.Flatten()(x)\nbranch = layers.Dense(64, activation=\"relu\")(x)\nclass_logits = layers.Dense(10, activation=\"softmax\", name=\"class_output\")(branch)\n\nfunc_model = keras.Model(inputs=inputs, outputs=class_logits)\nfunc_model.compile(optimizer=\"adam\", loss=\"sparse_categorical_crossentropy\", metrics=&#91;\"accuracy\"]) \n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-performance-tips-that-matter\">Performance tips that matter<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use tf.data with batch, map, cache, and prefetch to keep the GPU fed.<\/li>\n\n\n\n<li>Start with Adam and a small learning rate; adjust with ReduceLROnPlateau.<\/li>\n\n\n\n<li>Enable mixed precision on modern GPUs for speedups:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-8d5cc7b2ed13a30b4a469181429b8d0d\"><code>from tensorflow.keras import mixed_precision\nmixed_precision.set_global_policy(\"mixed_float16\")\n# If you do this, set the final Dense layer dtype=\"float32\" to avoid numeric issues.\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Scale out with MirroredStrategy for multi-GPU on one machine:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code has-white-color has-black-background-color has-text-color has-background has-link-color wp-elements-a90b26ed4d424b94cede5f76e4329b94\"><code>strategy = tf.distribute.MirroredStrategy()\nwith strategy.scope():\n    # build and compile model here\n    pass\n<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Profile a single epoch to find input bottlenecks before buying bigger GPUs.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-common-pitfalls-and-how-to-fix-them\">Common pitfalls and how to fix them<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Overfitting: add Dropout, use data augmentation, or collect more data. Monitor val_loss.<\/li>\n\n\n\n<li>Underfitting: increase model capacity, train longer, or raise learning rate slightly.<\/li>\n\n\n\n<li>Data leakage: strict train\/val\/test separation, no peeking.<\/li>\n\n\n\n<li>Unstable training: normalize inputs, check labels, reduce learning rate.<\/li>\n\n\n\n<li>Inconsistent results: set seeds and avoid mixing old checkpoints with new code.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-adapting-this-to-your-domain\">Adapting this to your domain<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Images: swap MNIST for your dataset; add data augmentation (RandomFlip, RandomRotation).<\/li>\n\n\n\n<li>Tabular: replace Conv2D with Dense stacks; use normalization and feature engineering.<\/li>\n\n\n\n<li>Text: use Embedding + LSTM\/GRU or Transformers from KerasNLP.<\/li>\n\n\n\n<li>Time series: 1D Conv, LSTM\/GRU, or Temporal Convolutional Networks.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-production-checklists\">Production checklists<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Version data, code, and models together; log metrics and hashes.<\/li>\n\n\n\n<li>Export a stable inference artifact (.keras or SavedModel) and keep an input schema.<\/li>\n\n\n\n<li>Add health checks and canary rollouts; monitor drift and performance in production.<\/li>\n\n\n\n<li>Retrain on a schedule or when drift exceeds a threshold.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-wrap-up\">Wrap up<\/h2>\n\n\n\n<p>Building with Keras is fast, readable, and production-ready when paired with TensorFlow\u2019s tooling. Define the goal, get the data right, keep the model simple first, and automate the boring-but-critical parts with callbacks and standardized saves. With these patterns, you can move from prototype to deployment confidently\u2014and repeatably\u2014for your next computer vision, NLP, or tabular ML project.<\/p>\n\n\n\n<ul class=\"wp-block-yoast-seo-related-links yoast-seo-related-links\">\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/\">Keras Functional API<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/22\/deep-learning-vs-machine-learning\/\">Deep Learning vs Machine Learning<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/08\/22\/what-is-supervised-fine-tuning-sft\/\">What is Supervised Fine-Tuning (SFT)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/15\/loading-and-saving-pytorch-weights\/\">Loading and Saving PyTorch Weights<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/15\/build-lean-reliable-net-docker-images-for-production\/\">Build Lean Reliable .NET Docker Images for Production<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to design, train, and deploy Keras models using TensorFlow\u2014from data prep to production-ready saves\u2014with practical code, clear steps, and tips for speed, accuracy, and maintainability.<\/p>\n","protected":false},"author":1,"featured_media":53944,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"Build a Keras Model for Real Projects","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"Learn to build a Keras model for real projects from start to finish, focusing on design, training, and deployment.","_yoast_wpseo_opengraph-title":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_twitter-title":"","_yoast_wpseo_twitter-description":"","_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[24,13,91],"tags":[],"class_list":["post-53934","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai","category-blog","category-keras"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Build a Keras Model for Real Projects - CPI Consulting<\/title>\n<meta name=\"description\" content=\"Learn to build a Keras model for real projects from start to finish, focusing on design, training, and deployment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Build a Keras Model for Real Projects\" \/>\n<meta property=\"og:description\" content=\"Learn to build a Keras model for real projects from start to finish, focusing on design, training, and deployment.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/\" \/>\n<meta property=\"og:site_name\" content=\"CPI Consulting\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-25T00:41:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-25T00:42:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cloudproinc.com.au\/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CPI Staff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CPI Staff\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/\"},\"author\":{\"name\":\"CPI Staff\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\"},\"headline\":\"Build a Keras Model for Real Projects\",\"datePublished\":\"2025-09-25T00:41:58+00:00\",\"dateModified\":\"2025-09-25T00:42:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/\"},\"wordCount\":705,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png\",\"articleSection\":[\"AI\",\"Blog\",\"Keras\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/\",\"url\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/\",\"name\":\"Build a Keras Model for Real Projects - CPI Consulting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/#primaryimage\"},\"thumbnailUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png\",\"datePublished\":\"2025-09-25T00:41:58+00:00\",\"dateModified\":\"2025-09-25T00:42:00+00:00\",\"description\":\"Learn to build a Keras model for real projects from start to finish, focusing on design, training, and deployment.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/#primaryimage\",\"url\":\"\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2025\\\/09\\\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png\",\"width\":1536,\"height\":1024},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/index.php\\\/2025\\\/09\\\/25\\\/build-a-keras-model-for-real-projects\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.cloudproinc.com.au\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Build a Keras Model for Real Projects\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#website\",\"url\":\"https:\\\/\\\/cloudproinc.com.au\\\/\",\"name\":\"Cloud Pro Inc - CPI Consulting Pty Ltd\",\"description\":\"Cloud, AI &amp; Cybersecurity Consulting | Melbourne\",\"publisher\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/cloudproinc.com.au\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#organization\",\"name\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\",\"url\":\"https:\\\/\\\/cloudproinc.com.au\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"contentUrl\":\"\\\/wp-content\\\/uploads\\\/2022\\\/01\\\/favfinalfile.png\",\"width\":500,\"height\":500,\"caption\":\"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd\"},\"image\":{\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/cloudproinc.com.au\\\/#\\\/schema\\\/person\\\/192eeeb0ce91062126ce3822ae88fe6e\",\"name\":\"CPI Staff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g\",\"caption\":\"CPI Staff\"},\"sameAs\":[\"http:\\\/\\\/www.cloudproinc.com.au\"],\"url\":\"https:\\\/\\\/cloudproinc.com.au\\\/index.php\\\/author\\\/cpiadmin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Build a Keras Model for Real Projects - CPI Consulting","description":"Learn to build a Keras model for real projects from start to finish, focusing on design, training, and deployment.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/","og_locale":"en_US","og_type":"article","og_title":"Build a Keras Model for Real Projects","og_description":"Learn to build a Keras model for real projects from start to finish, focusing on design, training, and deployment.","og_url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/","og_site_name":"CPI Consulting","article_published_time":"2025-09-25T00:41:58+00:00","article_modified_time":"2025-09-25T00:42:00+00:00","og_image":[{"width":1536,"height":1024,"url":"https:\/\/cloudproinc.com.au\/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png","type":"image\/png"}],"author":"CPI Staff","twitter_card":"summary_large_image","twitter_misc":{"Written by":"CPI Staff","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/#article","isPartOf":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/"},"author":{"name":"CPI Staff","@id":"https:\/\/cloudproinc.com.au\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e"},"headline":"Build a Keras Model for Real Projects","datePublished":"2025-09-25T00:41:58+00:00","dateModified":"2025-09-25T00:42:00+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/"},"wordCount":705,"commentCount":0,"publisher":{"@id":"https:\/\/cloudproinc.com.au\/#organization"},"image":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png","articleSection":["AI","Blog","Keras"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/","url":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/","name":"Build a Keras Model for Real Projects - CPI Consulting","isPartOf":{"@id":"https:\/\/cloudproinc.com.au\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/#primaryimage"},"image":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png","datePublished":"2025-09-25T00:41:58+00:00","dateModified":"2025-09-25T00:42:00+00:00","description":"Learn to build a Keras model for real projects from start to finish, focusing on design, training, and deployment.","breadcrumb":{"@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/#primaryimage","url":"\/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png","contentUrl":"\/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png","width":1536,"height":1024},{"@type":"BreadcrumbList","@id":"https:\/\/www.cloudproinc.com.au\/index.php\/2025\/09\/25\/build-a-keras-model-for-real-projects\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.cloudproinc.com.au\/"},{"@type":"ListItem","position":2,"name":"Build a Keras Model for Real Projects"}]},{"@type":"WebSite","@id":"https:\/\/cloudproinc.com.au\/#website","url":"https:\/\/cloudproinc.com.au\/","name":"Cloud Pro Inc - CPI Consulting Pty Ltd","description":"Cloud, AI &amp; Cybersecurity Consulting | Melbourne","publisher":{"@id":"https:\/\/cloudproinc.com.au\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudproinc.com.au\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudproinc.com.au\/#organization","name":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd","url":"https:\/\/cloudproinc.com.au\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudproinc.com.au\/#\/schema\/logo\/image\/","url":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","contentUrl":"\/wp-content\/uploads\/2022\/01\/favfinalfile.png","width":500,"height":500,"caption":"Cloud Pro Inc - Cloud Pro Inc - CPI Consulting Pty Ltd"},"image":{"@id":"https:\/\/cloudproinc.com.au\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/cloudproinc.com.au\/#\/schema\/person\/192eeeb0ce91062126ce3822ae88fe6e","name":"CPI Staff","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2d96eeb53b791d92c8c50dd667e3beec92c93253bb6ff21c02cfa8ca73665c70?s=96&d=mm&r=g","caption":"CPI Staff"},"sameAs":["http:\/\/www.cloudproinc.com.au"],"url":"https:\/\/cloudproinc.com.au\/index.php\/author\/cpiadmin\/"}]}},"jetpack_featured_media_url":"\/wp-content\/uploads\/2025\/09\/build-a-keras-model-for-real-projects-from-idea-to-deployment.png","jetpack-related-posts":[{"id":53931,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/keras-functional-api\/","url_meta":{"origin":53934,"position":0},"title":"Keras Functional API","author":"CPI Staff","date":"September 25, 2025","format":false,"excerpt":"A clear, practical guide to Keras Functional API\u2014why it matters and how to build flexible deep learning models with branching, sharing, and custom workflows.","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png 1x, \/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png 1.5x, \/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png 2x, \/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png 3x, \/wp-content\/uploads\/2025\/09\/keras-functional-api-demystified-for-flexible-deep-learning-workflows.png 4x"},"classes":[]},{"id":53933,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/deploy-a-model-with-tensorflow-serving\/","url_meta":{"origin":53934,"position":1},"title":"Deploy a Model with TensorFlow Serving","author":"CPI Staff","date":"September 25, 2025","format":false,"excerpt":"Learn to package, serve, and scale TensorFlow models using Docker and Kubernetes with TensorFlow Serving. Practical steps, code, and production tips for teams.","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 1x, \/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 1.5x, \/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 2x, \/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 3x, \/wp-content\/uploads\/2025\/09\/deploy-a-model-with-tensorflow-serving-on-docker-and-kubernetes.png 4x"},"classes":[]},{"id":53573,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/08\/06\/how-to-code-and-build-a-gpt-large-language-model\/","url_meta":{"origin":53934,"position":2},"title":"How to Code and Build a GPT Large Language Model","author":"CPI Staff","date":"August 6, 2025","format":false,"excerpt":"In this blog post, you\u2019ll learn how to code and build a GPT LLM from scratch or fine-tune an existing one. We\u2019ll cover the architecture, key tools, libraries, frameworks, and essential resources to get you started fast. Table of contentsUnderstanding GPT LLM ArchitectureModel Architecture DiagramTools and Libraries to Build a\u2026","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/08\/CreateLLM.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/08\/CreateLLM.png 1x, \/wp-content\/uploads\/2025\/08\/CreateLLM.png 1.5x, \/wp-content\/uploads\/2025\/08\/CreateLLM.png 2x, \/wp-content\/uploads\/2025\/08\/CreateLLM.png 3x, \/wp-content\/uploads\/2025\/08\/CreateLLM.png 4x"},"classes":[]},{"id":53929,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/turn-a-list-into-a-tensor-in-python\/","url_meta":{"origin":53934,"position":3},"title":"Turn a List into a Tensor in Python","author":"CPI Staff","date":"September 25, 2025","format":false,"excerpt":"Learn how to convert Python lists into tensors using NumPy, PyTorch, and TensorFlow, with tips on shapes, dtypes, performance, and common pitfalls.","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 1x, \/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 1.5x, \/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 2x, \/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 3x, \/wp-content\/uploads\/2025\/09\/turn-a-list-into-a-tensor-in-python-with-numpy-pytorch-tensorflow.png 4x"},"classes":[]},{"id":53930,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/deploying-deep-learning-models\/","url_meta":{"origin":53934,"position":4},"title":"Deploying Deep Learning Models","author":"CPI Staff","date":"September 25, 2025","format":false,"excerpt":"A practical guide to serving deep learning models as secure, scalable REST APIs using FastAPI, Docker, and Kubernetes\u2014covering performance, security, and monitoring for production.","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 1x, \/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 1.5x, \/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 2x, \/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 3x, \/wp-content\/uploads\/2025\/09\/deploying-deep-learning-models-as-fast-secure-rest-apis-in-production.png 4x"},"classes":[]},{"id":53960,"url":"https:\/\/cloudproinc.com.au\/index.php\/2025\/09\/25\/langchain-architecture-explained\/","url_meta":{"origin":53934,"position":5},"title":"LangChain Architecture Explained","author":"CPI Staff","date":"September 25, 2025","format":false,"excerpt":"A practical tour of LangChain\u2019s building blocks\u2014models, prompts, chains, memory, tools, and RAG\u2014plus LCEL, tracing, and deployment tips for production AI apps.","rel":"","context":"In &quot;AI&quot;","block_context":{"text":"AI","link":"https:\/\/cloudproinc.com.au\/index.php\/category\/ai\/"},"img":{"alt_text":"","src":"\/wp-content\/uploads\/2025\/09\/langchain-architecture-explained-for-agents-rag-and-production-apps.png","width":350,"height":200,"srcset":"\/wp-content\/uploads\/2025\/09\/langchain-architecture-explained-for-agents-rag-and-production-apps.png 1x, \/wp-content\/uploads\/2025\/09\/langchain-architecture-explained-for-agents-rag-and-production-apps.png 1.5x, \/wp-content\/uploads\/2025\/09\/langchain-architecture-explained-for-agents-rag-and-production-apps.png 2x, \/wp-content\/uploads\/2025\/09\/langchain-architecture-explained-for-agents-rag-and-production-apps.png 3x, \/wp-content\/uploads\/2025\/09\/langchain-architecture-explained-for-agents-rag-and-production-apps.png 4x"},"classes":[]}],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/53934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/comments?post=53934"}],"version-history":[{"count":2,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/53934\/revisions"}],"predecessor-version":[{"id":53952,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/posts\/53934\/revisions\/53952"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/media\/53944"}],"wp:attachment":[{"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/media?parent=53934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/categories?post=53934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudproinc.com.au\/index.php\/wp-json\/wp\/v2\/tags?post=53934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}