{"id":3404,"date":"2023-08-31T10:59:22","date_gmt":"2023-08-31T10:59:22","guid":{"rendered":"https:\/\/neuraldesigner.com\/blog\/milk-quality\/"},"modified":"2025-09-15T15:48:28","modified_gmt":"2025-09-15T13:48:28","slug":"milk-quality","status":"publish","type":"blog","link":"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/","title":{"rendered":"Inspect milk quality using machine learning"},"content":{"rendered":"<p>In this example, we will build a machine learning model to inspect milk quality by seven observable milk variables.<\/p>\n<p>Milk can be classified in terms of its quality into three groups: low quality, medium quality, and high quality.<\/p>\n<p>The central goal is to design a model that accurately classifies new milk samples. In other words, one that exhibits good generalization.<\/p>\n<p>This example is solved with <a href=\"https:\/\/www.neuraldesigner.com\/\">Neural Designer<\/a>. To follow it step by step, you can use the <a href=\"https:\/\/www.neuraldesigner.com\/free-trial\">free trial<\/a>.<\/p>\n<section>\n<section>\n<h3><span style=\"font-size: 16px;\">Contents<\/span><\/h3>\n<\/section>\n<ol>\n<li><a href=\"#ApplicationType\">Application type<\/a>.<\/li>\n<li><a href=\"#DataSet\">Data set<\/a>.<\/li>\n<li><a href=\"#NeuralNetwork\">Neural network<\/a>.<\/li>\n<li><a href=\"#TrainingStrategy\">Training strategy<\/a>.<\/li>\n<li><a href=\"#ModelSelection\">Model selection<\/a>.<\/li>\n<li><a href=\"#TestingAnalysis\">Testing analysis<\/a>.<\/li>\n<li><a href=\"#ModelDeployment\">Model deployment<\/a>.<\/li>\n<\/ol>\n<\/section>\n<section>\n<h2>1. Application type<\/h2>\n<p>This is a <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-networks-applications#Classification\">classification<\/a> project. Indeed, the variable to be predicted is categorical (low, medium, and high).<\/p>\n<p>The objective is to model the quality of the milk by knowing its characteristics and thus be able to make future predictions.<\/p>\n<\/section>\n<section>\n<h2>2. Data set<\/h2>\n<p>The first step is to prepare the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set\">dataset,<\/a> which is the source of information for the classification model.<\/p>\n<p>For that, we need to configure the following concepts:<\/p>\n<ul>\n<li>Data source.<\/li>\n<li>Variables.<\/li>\n<li>Instances.<\/li>\n<\/ul>\n<h3>Data source<\/h3>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#DataSource\">data source<\/a> for this example is the CSV file <a href=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/10\/milkquality.csv\">milk.csv<\/a>.<\/p>\n<p>The number of columns is 8, and the number of rows is 1060.<\/p>\n<h3>Variables<\/h3>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#Variables\">variables<\/a> are:<\/p>\n<h4>Numerical variables<\/h4>\n<ul>\n<li data-start=\"104\" data-end=\"146\"><strong data-start=\"104\" data-end=\"110\">pH<\/strong> \u2013 Milk pH, ranging from 3 to 9.5.<\/li>\n<li data-start=\"149\" data-end=\"215\"><strong data-start=\"149\" data-end=\"164\">temperature<\/strong> \u2013 Milk temperature, ranging from 34 \u00b0C to 90 \u00b0C.<\/li>\n<li data-start=\"218\" data-end=\"277\"><strong data-start=\"218\" data-end=\"228\">colour<\/strong> \u2013 Milk color, with values between 240 and 255.<\/li>\n<\/ul>\n<h4>Binary variables<\/h4>\n<ul>\n<li data-start=\"314\" data-end=\"346\"><strong data-start=\"314\" data-end=\"323\">taste<\/strong> \u2013 1 = good, 0 = bad.<\/li>\n<li data-start=\"349\" data-end=\"380\"><strong data-start=\"349\" data-end=\"357\">odor<\/strong> \u2013 1 = good, 0 = bad.<\/li>\n<li data-start=\"383\" data-end=\"413\"><strong data-start=\"383\" data-end=\"390\">fat<\/strong> \u2013 1 = good, 0 = bad.<\/li>\n<li data-start=\"416\" data-end=\"452\"><strong data-start=\"416\" data-end=\"429\">turbidity<\/strong> \u2013 1 = good, 0 = bad.<\/li>\n<\/ul>\n<h4>Target variable<\/h4>\n<\/section>\n<ul data-start=\"480\" data-end=\"567\">\n<li data-start=\"480\" data-end=\"567\">\n<p data-start=\"482\" data-end=\"567\"><strong data-start=\"482\" data-end=\"491\">grade<\/strong> \u2013 Milk quality class: <em data-start=\"514\" data-end=\"527\">low_quality<\/em>, <em data-start=\"529\" data-end=\"545\">medium_quality<\/em>, or <em data-start=\"550\" data-end=\"564\">high_quality<\/em>.<\/p>\n<\/li>\n<\/ul>\n<p>All variables in the study are inputs, except &#8220;grade&#8221;, which is the output that we want to extract from this machine learning study.<\/p>\n<p>Note that &#8220;grade&#8221; is categorical and can take the values low_quality, medium_quality, and high_quality.<\/p>\n<section>\n<h2>Instances<\/h2>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#Instances\">instances<\/a> are randomly split into 60.2% training (637 samples), 19.9% validation (211 samples), and 19.9% testing (211 samples).<\/p>\n<h3>Distributions<\/h3>\n<p>The following figure is the pie chart for the variable milk quality class, and it shows its <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#Distributions\">distribution<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/milk_pie_chart.webp\" \/><\/p>\n<p>The milk dataset has 429 low-quality, 374 medium-quality, and 256 high-quality instances.<\/p>\n<p>This shows an imbalanced target, with low quality making up 40.5% of the samples and high quality only 24.2%.<\/p>\n<\/section>\n<section>\n<h2>3. Neural network<\/h2>\n<p>The second step is to choose a <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network\">neural network<\/a>.<\/p>\n<p>The neural network must have seven inputs since the data set has seven input variables.<\/p>\n<p>The neural network has three outputs because we have three different &#8220;grades&#8221;: low_quality, medium_quality, and high_quality.<\/p>\n<p>In classification problems, it typically consists of:<\/p>\n<ul>\n<li>A scaling layer.<\/li>\n<li>Two dense layers.<\/li>\n<\/ul>\n<h3>Scaling layer<\/h3>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network#ScalingLayer\">scaling layer<\/a> normalizes the input values. As our inputs have different distributions, they are scaled with different methods:<\/p>\n<ul>\n<li>The variables pH, temperature, and colour are scaled with the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network#MeanStandardDeviationScalingMethod\">mean and standard deviation scaling method<\/a>.<\/li>\n<li>The variables taste, odor, fat, and turbidity are scaled with the <a>minimum and maximum scaling method<\/a>.<\/li>\n<\/ul>\n<h3>Dense layers<\/h3>\n<p>In this case, as the first guest, we only use one\u00a0<a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network#PerceptronsLayers\" target=\"_blank\" rel=\"noopener\">perceptron layer<\/a>.\u00a0This layer contains seven inputs, three neurons, and three outputs. For this example, the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network#PerceptronsLayers\">perceptron layer<\/a> is a <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network#LogisticActivationFunction\">hyperbolic tangent activation function<\/a>.<\/p>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network#ProbabilisticLayer\">probabilistic layer<\/a> allows for interpreting the outputs as probabilities. In this regard, all outputs are between 0 and 1, and their sum is 1. The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network#LogisticProbabilisticActivation\">softmax probabilistic activation<\/a> is used here.<\/p>\n<p>The following figure is a graphical representation of this <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network#ClassificationNeuralNetworks\">classification neural network<\/a>:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/milk_network_no_training.webp\" \/><\/p>\n<\/section>\n<section>\n<h2>4. Training strategy<\/h2>\n<p>The next step is to set the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy\">training strategy<\/a>, which comprises:<\/p>\n<ul>\n<li>Loss index.<\/li>\n<li>Optimization algorithm.<\/li>\n<\/ul>\n<h3>Loss index<\/h3>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#LossIndex\">loss index<\/a> chosen for this application is the\u00a0<a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#NormalizedSquaredError\">normalized squared error<\/a>\u00a0with <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#L2Regularization\">L2 regularization<\/a>.<\/p>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#ErrorTerm\">error term<\/a> fits the neural network to the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#TrainingInstances\">training instances<\/a> of the data set.<\/p>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#RegularizationTerm\">regularization term<\/a> makes the model more stable and improves generalization.<\/p>\n<h3>Optimization algorithm<\/h3>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#OptimizationAlgorithm\">optimization algorithm<\/a> searches for the neural network parameters that minimize the loss index.<\/p>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#QuasiNewtonMethod\">quasi-Newton method<\/a>\u00a0is chosen here.<\/p>\n<p>The following chart shows how the training (blue) and selection (orange) errors decrease with the epochs during training.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/milk_error.webp\" \/><\/p>\n<p>The final values are <b>training error = 0.252 NSE<\/b> (blue) and <b>selection error = 0.277 NSE<\/b> (orange).<\/p>\n<\/section>\n<section>\n<h2>5. Model selection<\/h2>\n<p>It is essential to have low selection error in our model, allowing us to generalize well to the new data rather than simply memorizing the training data.<\/p>\n<p>The objective of <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/model-selection\">model selection<\/a> is to find the network architecture with the best generalization properties. That is, the method that minimizes the error on the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#SelectionInstances\">selected instances<\/a> of the data set.<\/p>\n<p>We\u00a0<span style=\"box-sizing: border-box; margin: 0px; padding: 0px;\">aim to develop a neural network with a selection error of less than\u00a0<strong>0.277 NSE<\/strong>, the current best value we have achieved<\/span>.<\/p>\n<h3>Neuron selection<\/h3>\n<p><a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/model-selection#OrderSelection\">Order selection<\/a> algorithms train several network architectures with a different number of neurons and select the one with the smallest selection error.<\/p>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/model-selection#IncrementalOrder\">incremental order<\/a> method starts with a small number of neurons and increases the complexity at each iteration. The following chart shows the training error (blue) and the selection error (yellow) as a function of the number of neurons.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/milk_selection_neurons.webp\" \/><\/p>\n<p>As we can see, the number of neurons that yield the minimum error is four. Therefore, we select the neural network with four neurons in the hidden layer.<\/p>\n<p>The following chart shows the new neural network architecture.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/milk_network.webp\" \/><\/p>\n<p>The following chart shows how the training and selection errors decrease with the epochs during training in the new neural network. The final values are <b>training error = 0.0877 NSE<\/b> (blue) and <b>selection error = 0.107 NSE<\/b> (orange).<\/p>\n<p>With the new architecture of the neural network, we achieve around 50% less selection error.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/milk_errors.webp\" \/><\/p>\n<\/section>\n<section>\n<h2>6. Testing analysis<\/h2>\n<p>The purpose of the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/testing-analysis\">testing analysis<\/a> is to validate the generalization performance of the model.<\/p>\n<p>Here, we compare the neural network outputs to the corresponding targets in the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#TestingInstances\">testing instances<\/a> of the data set.<\/p>\n<h3>Confusion matrix<\/h3>\n<p>In the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/testing-analysis#ConfusionMatrix\">confusion matrix<\/a>, the rows represent the targets (or real values) and the columns the corresponding outputs (or predictive values).<\/p>\n<table>\n<tbody>\n<tr>\n<th><\/th>\n<th>Predicted low_quality<\/th>\n<th>Predicted medium_quality<\/th>\n<th>Predicted high_quality<\/th>\n<th>Total<\/th>\n<\/tr>\n<tr>\n<th>Real low_quality<\/th>\n<td style=\"text-align: right;\">49 (23.2%)<\/td>\n<td style=\"text-align: right;\">0<\/td>\n<td style=\"text-align: right;\">4 (1.9%)<\/td>\n<td style=\"text-align: right;\">53 (23.7%)<\/td>\n<\/tr>\n<tr>\n<th>Real medium_quality<\/th>\n<td style=\"text-align: right;\">1 (0.5%)<\/td>\n<td style=\"text-align: right;\">92 (43.6%)<\/td>\n<td style=\"text-align: right;\">0<\/td>\n<td style=\"text-align: right;\">93 (43.6%)<\/td>\n<\/tr>\n<tr>\n<th>Real high_quality<\/th>\n<td style=\"text-align: right;\">0<\/td>\n<td style=\"text-align: right;\">0<\/td>\n<td style=\"text-align: right;\">65 (30.8%)<\/td>\n<td style=\"text-align: right;\">65 (32.7%)<\/td>\n<\/tr>\n<tr>\n<th>Total<\/th>\n<td style=\"text-align: right;\">50 (23.7%)<\/td>\n<td style=\"text-align: right;\">92 (43.6%)<\/td>\n<td style=\"text-align: right;\">69 (32.7%)<\/td>\n<td style=\"text-align: right;\">211 (100%)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The number of correctly <b>classified samples<\/b> is <b>206<\/b>, and the number of <b>misclassified samples<\/b> is <b>5<\/b>.<\/p>\n<h3>Multiple classification metrics<\/h3>\n<p>The confusion matrix allows us to calculate the model&#8217;s accuracy and error:<\/p>\n<ul>\n<li><b>Classification accuracy: 97.6%<\/b>.<\/li>\n<li><b>Error rate: 2.4%<\/b>.<\/li>\n<\/ul>\n<\/section>\n<section>\n<h2>7. Model deployment<\/h2>\n<p>The neural network is now ready to predict outputs for inputs that it has never seen. This process is called <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/model-deployment\">model deployment<\/a>.<\/p>\n<h3>Outputs<\/h3>\n<p>To classify a sample of milk, we calculate the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/model-deployment#NeuralNetworkOutputs\">neural network outputs<\/a>.<\/p>\n<p>For instance, consider a sample with the following features:<\/p>\n<ul>\n<li>ph: 6.63<\/li>\n<li>temperature: 39.2<\/li>\n<li>taste: 0<\/li>\n<li>odor: 1<\/li>\n<li>fat: 1<\/li>\n<li>turbidity: 1<\/li>\n<\/ul>\n<p>The neural network outputs for these features are:<\/p>\n<ul>\n<li><b>high_quality: <\/b>91.2%<\/li>\n<li><b>medium_quality: <\/b>8.73%<\/li>\n<li><b>low_quality: <\/b>0.07%<\/li>\n<\/ul>\n<p>For this particular case, the neural network would classify the sample of milk as being of <b>high quality<\/b>\u00a0since it has the highest probability.<\/p>\n<pre>We can implement this expression in any programming language to obtain the output for our input.<\/pre>\n<\/section>\n<section>\n<h2>References<\/h2>\n<ul>\n<li>Kaggle. Machine Learning and Data Science Community: <a href=\"https:\/\/www.kaggle.com\/datasets\/cpluzshrijayan\/milkquality?resource=download\">Milk Dataset<\/a>.<\/li>\n<\/ul>\n<h2>Related posts<\/h2>\n<\/section>\n","protected":false},"author":24,"featured_media":4720,"template":"","categories":[],"tags":[49,43],"class_list":["post-3404","blog","type-blog","status-publish","has-post-thumbnail","hentry","tag-food","tag-industry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Inspect milk quality using machine learning<\/title>\n<meta name=\"description\" content=\"Build a machine learning model to inspect milk quality into three groups by seven observable milk variables.\" \/>\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.neuraldesigner.com\/blog\/milk-quality\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Inspect milk quality using machine learning\" \/>\n<meta property=\"og:description\" content=\"Build a machine learning model to inspect milk quality into three groups by seven observable milk variables.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/\" \/>\n<meta property=\"og:site_name\" content=\"Neural Designer\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-15T13:48:28+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/portada_leche.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@NeuralDesigner\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/\",\"url\":\"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/\",\"name\":\"Inspect milk quality using machine learning\",\"isPartOf\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/portada_leche.png\",\"datePublished\":\"2023-08-31T10:59:22+00:00\",\"dateModified\":\"2025-09-15T13:48:28+00:00\",\"description\":\"Build a machine learning model to inspect milk quality into three groups by seven observable milk variables.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#primaryimage\",\"url\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/portada_leche.png\",\"contentUrl\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/portada_leche.png\",\"width\":1200,\"height\":628},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.neuraldesigner.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Blog\",\"item\":\"https:\/\/www.neuraldesigner.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Inspect milk quality using machine learning\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.neuraldesigner.com\/#website\",\"url\":\"https:\/\/www.neuraldesigner.com\/\",\"name\":\"Neural Designer\",\"description\":\"Explanable AI Platform\",\"publisher\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.neuraldesigner.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.neuraldesigner.com\/#organization\",\"name\":\"Neural Designer\",\"url\":\"https:\/\/www.neuraldesigner.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.neuraldesigner.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/05\/logo-neural-1.png\",\"contentUrl\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/05\/logo-neural-1.png\",\"width\":1024,\"height\":223,\"caption\":\"Neural Designer\"},\"image\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/NeuralDesigner\",\"https:\/\/es.linkedin.com\/showcase\/neuraldesigner\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Inspect milk quality using machine learning","description":"Build a machine learning model to inspect milk quality into three groups by seven observable milk variables.","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.neuraldesigner.com\/blog\/milk-quality\/","og_locale":"en_US","og_type":"article","og_title":"Inspect milk quality using machine learning","og_description":"Build a machine learning model to inspect milk quality into three groups by seven observable milk variables.","og_url":"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/","og_site_name":"Neural Designer","article_modified_time":"2025-09-15T13:48:28+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/portada_leche.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@NeuralDesigner","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/","url":"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/","name":"Inspect milk quality using machine learning","isPartOf":{"@id":"https:\/\/www.neuraldesigner.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#primaryimage"},"image":{"@id":"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#primaryimage"},"thumbnailUrl":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/portada_leche.png","datePublished":"2023-08-31T10:59:22+00:00","dateModified":"2025-09-15T13:48:28+00:00","description":"Build a machine learning model to inspect milk quality into three groups by seven observable milk variables.","breadcrumb":{"@id":"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#primaryimage","url":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/portada_leche.png","contentUrl":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/portada_leche.png","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/www.neuraldesigner.com\/blog\/milk-quality\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.neuraldesigner.com\/"},{"@type":"ListItem","position":2,"name":"Blog","item":"https:\/\/www.neuraldesigner.com\/blog\/"},{"@type":"ListItem","position":3,"name":"Inspect milk quality using machine learning"}]},{"@type":"WebSite","@id":"https:\/\/www.neuraldesigner.com\/#website","url":"https:\/\/www.neuraldesigner.com\/","name":"Neural Designer","description":"Explanable AI Platform","publisher":{"@id":"https:\/\/www.neuraldesigner.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.neuraldesigner.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.neuraldesigner.com\/#organization","name":"Neural Designer","url":"https:\/\/www.neuraldesigner.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.neuraldesigner.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/05\/logo-neural-1.png","contentUrl":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/05\/logo-neural-1.png","width":1024,"height":223,"caption":"Neural Designer"},"image":{"@id":"https:\/\/www.neuraldesigner.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/NeuralDesigner","https:\/\/es.linkedin.com\/showcase\/neuraldesigner\/"]}]}},"_links":{"self":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/blog\/3404","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/blog"}],"about":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/types\/blog"}],"author":[{"embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/users\/24"}],"version-history":[{"count":0,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/blog\/3404\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/media\/4720"}],"wp:attachment":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/media?parent=3404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/categories?post=3404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/tags?post=3404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}