{"id":373,"date":"2022-11-27T20:59:00","date_gmt":"2022-11-27T12:59:00","guid":{"rendered":"https:\/\/philip.twinight.co\/portfolio\/?p=373"},"modified":"2024-03-06T22:16:23","modified_gmt":"2024-03-06T14:16:23","slug":"automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates","status":"publish","type":"post","link":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/","title":{"rendered":"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates"},"content":{"rendered":"\n<p>This is the group project of SDSC3006 \u2013 Fundamentals of Machine Learning I. I did the project in my year 3 2022\/23 Semester A.<\/p>\n\n\n\n<p><strong>Presentation Slides:<\/strong><\/p>\n\n\n<div class=\"ose-google-docs ose-uid-d84d6ab824cf285e3fe683ba495e61fc ose-embedpress-responsive\" style=\"width:600px; height:550px; max-height:550px; max-width:100%; display:inline-block;\" data-embed-type=\"GoogleDocs\"><iframe loading=\"lazy\" allowFullScreen=\"true\" src=\"https:\/\/docs.google.com\/presentation\/d\/e\/2PACX-1vTRQSiK39HJUsM_JUUl3irUwNJhXdR_0Kj7h4Ox5HRJKnEtvb0dqOrHBsV_9vmQag\/embed?start=false&#038;loop=false&#038;delayms=3000\" frameborder=\"0\" width=\"600\" height=\"550\" allowfullscreen=\"true\" mozallowfullscreen=\"true\" webkitallowfullscreen=\"true\"><\/iframe><\/div>\n\n\n\n<p>Course Instructor: Prof. ZENG Li<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#Introduction\" >Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#Dataset_Source\" >Dataset Source<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#Dataset_Background\" >Dataset Background<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#Methodology\" >Methodology<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#Findings\" >Findings<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#Appendix\" >Appendix<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Introduction\"><\/span>Introduction<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In this final project, me and my groupmates will be analyzing a dataset related to steel plates&#8217; faults. The dataset consists of various features of steel plates, classified into seven different types of faults. The objective is to apply machine learning techniques to automatically recognize patterns and classify the steel plates based on their faults. This analysis aims to extend the learning from the course and provide insights into the practical application of machine learning in the field of material science.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Dataset_Source\"><\/span>Dataset Source<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The dataset used in this project is the &#8220;Steel Plates Faults&#8221; dataset, which was donated to the UCI Machine Learning Repository on October 25, 2010. It contains data on steel plates&#8217; faults, classified into seven different types. The dataset comprises 1941 instances, each with 27 features, including both integer and real-valued attributes. The features represent various characteristics of the steel plates, such as dimensions, area, perimeter, luminosity, and type of steel, among others.<\/p>\n\n\n\n<p>The dataset can be accessed and downloaded from the UCI Machine Learning Repository through the following link: <a href=\"https:\/\/archive.ics.uci.edu\/dataset\/198\/steel+plates+faults\" target=\"_blank\" rel=\"noreferrer noopener\">Steel Plates Faults &#8211; UCI Machine Learning Repository<\/a>.<\/p>\n\n\n\n<p>Additionally, the dataset can be easily imported into a Python environment using the <code>ucimlrepo<\/code> package, as demonstrated in the dataset description. This facilitates the process of loading the data for analysis and model building in the project.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Dataset_Background\"><\/span>Dataset Background<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The &#8220;Steel Plates Faults&#8221; dataset is a multivariate dataset that falls under the subject area of physics and chemistry. It is primarily used for classification tasks in machine learning. The dataset does not contain any missing values, ensuring a smooth analysis process. The seven types of steel plates faults included in the dataset are Pastry, Z_Scratch, K_Scatch, Stains, Dirtiness, Bumps, and Other_Faults. Each instance in the dataset represents a steel plate with its corresponding features and fault type. This dataset provides a valuable resource for developing and testing machine learning models for automatic pattern recognition and classification in the context of material science.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Methodology\"><\/span>Methodology<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-opt-id=2019354972  fetchpriority=\"high\" loading=\"eager\" decoding=\"async\" width=\"885\" height=\"841\" src=\"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-32.png\" alt=\"\" class=\"wp-image-377\" srcset=\"https:\/\/mlcznkdztmb6.i.optimole.com\/w:885\/h:841\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-32.png 885w, https:\/\/mlcznkdztmb6.i.optimole.com\/w:300\/h:285\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-32.png 300w, https:\/\/mlcznkdztmb6.i.optimole.com\/w:768\/h:730\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-32.png 768w\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" \/><\/figure>\n\n\n\n<p>The analysis began with a pre-analysis stage, where the integrity of the dataset was confirmed; no missing or null values were found. This provided a solid foundation for a reliable analysis. A heatmap was generated to visualize the correlations among the variables, highlighting significant relationships, especially between luminosity-related features and the steel plates&#8217; perimeter.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-opt-id=1399608375  fetchpriority=\"high\" loading=\"eager\" decoding=\"async\" width=\"491\" height=\"459\" src=\"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-30.png\" alt=\"\" class=\"wp-image-375\" srcset=\"https:\/\/mlcznkdztmb6.i.optimole.com\/w:491\/h:459\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-30.png 491w, https:\/\/mlcznkdztmb6.i.optimole.com\/w:300\/h:280\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-30.png 300w\" sizes=\"auto, (max-width: 491px) 100vw, 491px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-opt-id=1626933602  loading=\"lazy\" decoding=\"async\" width=\"520\" height=\"446\" src=\"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-31.png\" alt=\"\" class=\"wp-image-376\" srcset=\"https:\/\/mlcznkdztmb6.i.optimole.com\/w:520\/h:446\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-31.png 520w, https:\/\/mlcznkdztmb6.i.optimole.com\/w:300\/h:257\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-31.png 300w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/figure>\n\n\n\n<p>Following the preliminary examination, Principal Component Analysis (PCA) was employed to reduce the dataset&#8217;s dimensionality. This method transformed the dataset into a set of linearly uncorrelated variables, known as principal components (PCs). It was determined that ten PCs accounted for 90% of the variance in the dataset, thus providing a simplified yet comprehensive view of the data for further analysis.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img data-opt-id=1306600143  loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"639\" src=\"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-29.png\" alt=\"\" class=\"wp-image-374\" srcset=\"https:\/\/mlcznkdztmb6.i.optimole.com\/w:650\/h:639\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-29.png 650w, https:\/\/mlcznkdztmb6.i.optimole.com\/w:300\/h:295\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-29.png 300w, https:\/\/mlcznkdztmb6.i.optimole.com\/w:50\/h:50\/q:mauto\/f:best\/ig:avif\/dpr:2\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/image-29.png 50w\" sizes=\"auto, (max-width: 650px) 100vw, 650px\" \/><\/figure>\n\n\n\n<p>Using the first ten PCs, a decision tree model was constructed using the ANOVA method to predict the types of faults in steel plates. The model was specifically applied to predict bumps as a type of fault. The decision tree provided a clear, visual representation of the classification process, delineating the path taken to reach a prediction based on the values of the PCs.<\/p>\n\n\n\n<p><img data-opt-id=2021139030  loading=\"eager\" decoding=\"async\" width=\"341px;\" height=\"250px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/rirLwpWWNuHlAbO14_GTEKKf41g_tq6PtEnACwd2GVlxS-G1rddLWbxXiqlU4qvNs0iyi7Sk6cluLt0zmg8X-J8NqHgzFeRJvM4SAy_qtSKkx8k4HhBZHEIdn4ZfNqmJVsHsAsfen-L71f7uouUphQz5MQ=s2048\"><\/p>\n\n\n\n<p><img data-opt-id=2119167826  loading=\"eager\" decoding=\"async\" width=\"294px;\" height=\"24px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/F9iIcaNY2wo6-1zsb9kJgK9Pz0sXYG0kUdCRFQ0WoE49LWVymS2lgPplFmcSP9mpdPpCuh_aTN9Kj9DKncz2hdYGq1P0Gl4g6h3ZKQSKJ6MElC9UsfnXriU2EudpkI5477bAB0lcLVF1kQlHrc2T50lpKA=s2048\"><\/p>\n\n\n\n<p>To assess the model&#8217;s performance, a confusion matrix was constructed for a K Nearest Neighbors classifier. This matrix served as an accuracy indicator, though it also revealed that surface defects were prone to misclassification.<\/p>\n\n\n\n<p><img data-opt-id=995870394  loading=\"eager\" decoding=\"async\" width=\"332px;\" height=\"239px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/CrtjOTm2ZdYaFwwSPr2o6NqzpldjsB9KBg5AkRFGSeaYxA6mcXkRO2gRbZfekPWn9ObMbBjmh5UyUYW81P9IXKqbkwRbaxVRS-MXbo5JhafiH-gF0h_a3liH3zonBq15mNk3lWjmKO8TTt9TWnO1NC3QxQ=s2048\"><\/p>\n\n\n\n<p><img data-opt-id=591413775  loading=\"eager\" decoding=\"async\" width=\"325px;\" height=\"233px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/AzpKX4wX9-ggbmhqkU55BvCBWKT1kZhuTLNnQEW0N24FWar20d0sXM47awK5rV34bfOqrpR9V9JIclEq2-F5im6LUIGY7mnEfq8zwoiSLOiwUwqOKwqLk8ZLD9V3vRfTc9ADytOvDBOphcrolYskrz_d4g=s2048\"><\/p>\n\n\n\n<p>The K-value&#8217;s impact on the model&#8217;s accuracy was evaluated, revealing that a balance needed to be struck to avoid overfitting; the model&#8217;s complexity adversely affected its performance.<\/p>\n\n\n\n<p><img data-opt-id=90641746  loading=\"eager\" decoding=\"async\" width=\"319px;\" height=\"263px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/vopFzLjSISl390Rgw7IyFGDUJIQHxfNkpXuXXqphVDWTLvdpHsEvlUXBrf2rP7oe-nZ7m8XJXLhcXmxhr5TyD-meVyOVRBNZfrO8xJlodWIkm4wriP0wI9_gu6WGnWQIi7ozkoeIe9fLA9CCBNTs-tKuZg=s2048\"><\/p>\n\n\n\n<p><img data-opt-id=45008185  loading=\"eager\" decoding=\"async\" width=\"875px;\" height=\"28px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/L0EbNWGI51qP2GZ7VTlwQyUV0YZTmh4U62vueuaiCOBwWEFeUVtQ7x6xhAdKx4kf1XCgws7HUqQ_JU3K73RO4MoBq4hvnz3vfk-xOifJTd6KHjtZyvLSiQxfqpTEMq8Ej9taPUZRyNqqKcU5vNDMuSJi_Q=s2048\"><\/p>\n\n\n\n<p>The Random Forest model was then introduced, employing the GridSearchCV function in Python to optimize the model&#8217;s parameters. The chosen metrics included the criterion of entropy, with one hundred trees, and no limit on the maximum depth or the number of features considered for the best split.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Findings\"><\/span>Findings<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><img data-opt-id=1342173242  loading=\"eager\" decoding=\"async\" width=\"321px;\" height=\"268px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/yzdUykaDN9o84rTSaTNe_9Lq9FZpvJd93rvMuSAMP-KwkeQ24nfXo6aP1oHx-DSiL98qVFJJ6R8UBlHguOS09L9-BQGkII62eBBB5o24vzDTt0uSIVgfvCfRAHmHrD3LxIB-IyC5zJApCO1e7kXEHCiKIQ=s2048\"><\/p>\n\n\n\n<p>The Decision Tree and Random Forest models demonstrated varying degrees of success in classifying the types of steel plates faults. While the Random Forest model exhibited approximately 69% accuracy, it was noted that this came with a relatively high computational cost, affecting the model&#8217;s efficiency.<\/p>\n\n\n\n<p>Precision-recall analysis within the Random Forest model indicated that it predicted K_Scatch and Dirtiness faults with the highest precision. Conversely, other fault types, such as Bumps and Stains, presented challenges for the model.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><img data-opt-id=706173132  loading=\"eager\" decoding=\"async\" width=\"384px;\" height=\"192px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/YSI7zWMjKVhaHqt-8Uq7yNlF6HBFIfppXMP8GtmMGY0Xl0LXGNVqWCrGpwBDtAcPIyVN0MwEf5fwiYO0u82rzMs-5Jq37A0nG8FWEyVfAQfnEtWh5HIribGxqVtr1gSkRyE9NEvtIDBYNZ9Ko6kHPFzVNQ=s2048\"><\/p>\n\n\n\n<p>The analysis successfully leveraged techniques of machine learning to classify faults in steel plates. Despite the computational intensity, the Random Forest model proved to be a robust classifier, offering a balance between precision and recall, thus making it a reliable predictor for certain types of faults. The K Nearest Neighbors classifier, while simpler and faster, was less effective at distinguishing between the different fault categories. It was particularly challenged by overlapping fault characteristics that led to misclassifications.<\/p>\n\n\n\n<p>Through the process of model selection and optimization, this project highlighted the importance of choosing the right model based on the specific characteristics of the dataset. The need to balance the model&#8217;s complexity with its predictive power was evident, particularly when dealing with a high-dimensional space and a multitude of classes, as in the case of the steel plates faults dataset.<\/p>\n\n\n\n<p>First Decision Tree from the Random Forest:<\/p>\n\n\n\n<p><img data-opt-id=293634695  loading=\"eager\" decoding=\"async\" width=\"422px;\" height=\"376px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/NIC9RfWSdGZbjfRtgBuEce0VqGHBttTHMQyZLQ1-9VNVyPEazzfW2tz5NC6CoWFlyEWRsn0Sealci6v3HteBPaqXto8BQXjsFqpp5TxQLedFuKNn0DL1RlxtjgBlYZ5XlNY185GH7N1HenJMCC04iJBngw=s2048\"><\/p>\n\n\n\n<p>First Decision Tree with Max Depth=2:<\/p>\n\n\n\n<p><img data-opt-id=724038342  loading=\"eager\" decoding=\"async\" width=\"510px;\" height=\"275px;\" src=\"https:\/\/lh7-us.googleusercontent.com\/W4_Q3WH_GjWGiIqRjZcbDDy4frEVAnkMxtXU7585oDXQe-sGgoAlkvrKwmrfUa6y-2ZsMSZvaMI_quv7qwdI2ECBvRKHYnMBUDOq-0ErVJwLwtZvSY6LPX0yxK-jmrJqYeQ-4_nmpp7Lr773IKf3fWtvqg=s2048\"><\/p>\n\n\n\n<p>The final step was to refine the Decision Tree within the Random Forest, limiting its depth to enhance interpretability and prevent overfitting. The final Decision Tree model, with a maximum depth of two, provided a more interpretable and visually comprehensible model, though at the cost of detailed granularity.<\/p>\n\n\n\n<p>In summary, this project not only solidified the theoretical knowledge gained from the class but also provided a practical application of machine learning techniques to a real-world problem. It underscored the potential of machine learning in industrial applications, particularly in automating the fault classification process in manufacturing environments, which can significantly enhance quality control measures.<\/p>\n\n\n\n<p>The journey from pre-analysis to the conclusion has underscored the iterative nature of data science; through trial and error, refinement of techniques, and validation of results, we can draw meaningful insights from data.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Appendix\"><\/span>Appendix<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Our Code:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\n# Importing necessary libraries for data manipulation and visualization\nimport numpy as np\nimport pandas as pd\nimport matplotlib.pyplot as plt\nimport seaborn as sns\nfrom subprocess import check_output\n\n# Importing machine learning libraries and functions\nfrom sklearn.model_selection import train_test_split\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.metrics import accuracy_score\nfrom sklearn.metrics import confusion_matrix\n\ndf = pd.read_csv('faults.csv')\n\n# Selecting the label columns (the first seven columns of the dataset)\nlabel_columns = df.columns.values&#x5B;:7]\n\n# Separating the target variable which is the maximum fault type label for each instance\ntargets = (df.iloc&#x5B;:, :7] == 1).idxmax(1)\n\n# Preparing the dataset by dropping the label columns and adding a target column\ndataset = df.drop(label_columns, axis=1)\ndataset&#x5B;'target'] = targets\n\n# Dropping additional columns that are not needed for the analysis\ndataset = dataset.drop('TypeOfSteel_A400', axis=1)\ndataset = dataset.drop('X_Minimum', axis=1)\ndataset = dataset.drop('Y_Minimum', axis=1)\n\n# Selecting features for the model (first 24 columns)\nX = dataset.iloc&#x5B;:, :24]\n\n# Selecting the target column for the model\ny = dataset.iloc&#x5B;:, 24]\n\n# Splitting the dataset into training and testing sets with a test size of 20%\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.2, random_state = 0)\n\n# Instantiating the KNN classifier with 19 neighbors\nknn = KNeighborsClassifier(n_neighbors=19)\n\n# Fitting the model on the training data\nknn.fit(X_train, y_train)\n\n# Predicting on the test set and printing the accuracy\nclassifier = knn.fit(X_train, y_train)\nprint(&quot;KNN accuracy:&quot;, knn.score(X_test, y_test))\n\n# Plotting the confusion matrix to visualize the performance of the classifier\nplot_confusion_matrix(classifier, X_test, y_test, labels=None, sample_weight=None, normalize=None)\nplt.show()\n\n# This second part of the code is for finding the best number of neighbors\nfrom sklearn.neighbors import KNeighborsClassifier\nfrom sklearn.model_selection import train_test_split\n\n# Preparing features and target variable again\nX, y = df.loc&#x5B;:, df.columns != 'class'], df.loc&#x5B;:, 'class']\n\n# Splitting the dataset into training and testing sets with a test size of 30% and shuffling\nX_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.3, random_state = 2, shuffle=True)\n\n# Initializing lists to store accuracy for training and testing sets\ntrain_accuracy = &#x5B;]\ntest_accuracy = &#x5B;]\n\n# Trying different numbers of neighbors to find the best one\nneig = np.arange(1, 27)\nfor i, k in enumerate(neig):\n    knn = KNeighborsClassifier(n_neighbors=k)\n    knn.fit(X_train, y_train)\n\n    # Storing the accuracy for the current number of neighbors\n    train_accuracy.append(knn.score(X_train, y_train))\n    test_accuracy.append(knn.score(X_test, y_test))\n\n# Plotting the accuracy for different numbers of neighbors\nplt.figure(figsize=(13, 8))\nplt.plot(neig, test_accuracy, label = 'Testing Accuracy')\nplt.plot(neig, train_accuracy, label = 'Training Accuracy')\nplt.legend()\n\n# Labeling the plot\nplt.title('k value VS Accuracy')\nplt.xlabel('Number of Neighbors')\nplt.ylabel('Accuracy')\n\n# Showing the plot\nplt.show()\n\n# Printing the best accuracy and corresponding k\nprint(&quot;Best accuracy is {} with k = {}&quot;.format(np.max(test_accuracy),1+test_accuracy.index(np.max(test_accuracy))))\n<\/pre><\/div>\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: python; title: ; notranslate\" title=\"\">\nimport pandas as pd\nimport numpy as np\nimport seaborn as sns\nimport matplotlib.pyplot as plt\nfrom sklearn.model_selection import train_test_split, GridSearchCV\nfrom sklearn.ensemble import RandomForestClassifier\nfrom sklearn.metrics import confusion_matrix, classification_report\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn import tree\n%matplotlib inline\n\n# Ignore warnings\nimport warnings\nwarnings.filterwarnings(&quot;ignore&quot;)\n\n# Load dataset\ndf = pd.read_csv(&quot;faults.csv&quot;)\n\n# Define conditions and choices for class labels\nconditions = &#x5B;\n    (df&#x5B;'Pastry'] == 1) &amp; (df&#x5B;'Z_Scratch'] == 0) &amp; (df&#x5B;'K_Scatch'] == 0) &amp; (df&#x5B;'Stains'] == 0) &amp; (df&#x5B;'Dirtiness'] == 0) &amp; (df&#x5B;'Bumps'] == 0) &amp; (df&#x5B;'Other_Faults'] == 0),\n    (df&#x5B;'Pastry'] == 0) &amp; (df&#x5B;'Z_Scratch'] == 1) &amp; (df&#x5B;'K_Scatch'] == 0) &amp; (df&#x5B;'Stains'] == 0) &amp; (df&#x5B;'Dirtiness'] == 0) &amp; (df&#x5B;'Bumps'] == 0) &amp; (df&#x5B;'Other_Faults'] == 0),\n    # Add other conditions here\n]\nchoices = &#x5B;'Pastry', 'Z_Scratch', 'K_Scatch', 'Stains', 'Dirtiness', 'Bumps', 'Other_Faults']\n\n# Create a new column for class labels\ndf&#x5B;'class'] = np.select(conditions, choices)\n\n# Drop unnecessary columns\ndf.drop(choices, inplace=True, axis=1)\n\n# Define features and target variable\nx = df.drop('class', axis=1)\ny = df&#x5B;'class']\n\n# Split data into training and test sets\nx_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=1, stratify=y)\n\n# Standardize features\nscaler = StandardScaler()\nx_train = scaler.fit_transform(x_train)\nx_test = scaler.transform(x_test)\n\n# Function to evaluate and fit the model\ndef model_eval(model, param_grid, cv=5):\n    grid_search = GridSearchCV(model, param_grid, cv=cv)\n    grid_search.fit(x_train, y_train)\n\n    # Print best parameters\n    print(&quot;Best Parameters:&quot;, grid_search.best_params_)\n\n    # Make predictions\n    y_pred = grid_search.predict(x_test)\n\n    # Confusion matrix\n    cm = confusion_matrix(y_test, y_pred)\n    sns.heatmap(cm, annot=True, fmt='d', cmap='Blues')\n    plt.xlabel('Predicted')\n    plt.ylabel('True')\n    plt.show()\n\n    # Print model accuracy and classification report\n    print(&quot;Model Accuracy:&quot;, round(grid_search.score(x_test, y_test) * 100, 3))\n    print(classification_report(y_test, y_pred))\n\n# Define the model and parameter grid\nrf = RandomForestClassifier()\nparam_grid = {\n    'n_estimators': &#x5B;50, 100, 200],\n    'criterion': &#x5B;'gini', 'entropy'],\n    'min_samples_split': &#x5B;2, 5, 10],\n    'max_depth': &#x5B;None, 2],\n    'min_samples_leaf': &#x5B;1, 5, 10],\n    'max_features': &#x5B;None, 'auto', 'sqrt', 'log2']\n}\n\n# Evaluate the model\nmodel_eval(rf, param_grid)\n\n# Example of fitting a RandomForestClassifier with specific parameters\nrf1 = RandomForestClassifier(n_estimators=50, min_samples_split=2, min_samples_leaf=1, max_features=None, max_depth=2, criterion='entropy')\nrf1.fit(x_train, y_train)\n\n# Print the maximum depth of the first tree\nprint(&quot;Maximum depth of the first tree:&quot;, rf1.estimators_&#x5B;0].tree_.max_depth)\n\n# Visualize one of the trees from the random forest\nplt.rcParams.update({'figure.figsize': (12, 8)})\nplt.rcParams.update({'font.size': 14})\n_ = tree.plot_tree(rf1.estimators_&#x5B;0], feature_names=df.columns&#x5B;:-1], filled=True)\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>This is the group project of SDSC3006 \u2013 Fundamentals of Machine Learning I. I did the project in my year 3 2022\/23 Semester A. Presentation Slides: Course Instructor: Prof. ZENG &hellip; <a href=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/\" class=\"more-link\"><span>Continue reading<span class=\"screen-reader-text\">Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates<\/span><\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":380,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[72,3],"tags":[33,13,36,35,34],"class_list":["post-373","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-learning","category-proj","tag-2022-23-semester-a","tag-data-science","tag-fundamentals-of-machine-learning-i","tag-sdsc3006","tag-year-3"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates - Philip\u2019s Data Science Diary<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates - Philip\u2019s Data Science Diary\" \/>\n<meta property=\"og:description\" content=\"This is the group project of SDSC3006 \u2013 Fundamentals of Machine Learning I. I did the project in my year 3 2022\/23 Semester A. Presentation Slides: Course Instructor: Prof. ZENG &hellip; Continue readingAutomating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates\" \/>\n<meta property=\"og:url\" content=\"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/\" \/>\n<meta property=\"og:site_name\" content=\"Philip\u2019s Data Science Diary\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-27T12:59:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-06T14:16:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/FaultFinder.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Philip\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Philip\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/\"},\"author\":{\"name\":\"Philip\",\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/#\\\/schema\\\/person\\\/ef4f7cedd9b3bde11e126c4dbe1f8414\"},\"headline\":\"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates\",\"datePublished\":\"2022-11-27T12:59:00+00:00\",\"dateModified\":\"2024-03-06T14:16:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/\"},\"wordCount\":1045,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/#\\\/schema\\\/person\\\/ef4f7cedd9b3bde11e126c4dbe1f8414\"},\"image\":{\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\/\\/philip.twinight.co\\/portfolio\\/wp-content\\/uploads\\/2024\\/03\\/FaultFinder.png\",\"keywords\":[\"2022\\\/23 Semester A\",\"Data Science\",\"Fundamentals of Machine Learning I\",\"SDSC3006\",\"Year 3\"],\"articleSection\":[\"Machine Learning\",\"Projects\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/\",\"url\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/\",\"name\":\"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates - Philip\u2019s Data Science Diary\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\/\\/philip.twinight.co\\/portfolio\\/wp-content\\/uploads\\/2024\\/03\\/FaultFinder.png\",\"datePublished\":\"2022-11-27T12:59:00+00:00\",\"dateModified\":\"2024-03-06T14:16:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/#primaryimage\",\"url\":\"https:\\/\\/philip.twinight.co\\/portfolio\\/wp-content\\/uploads\\/2024\\/03\\/FaultFinder.png\",\"contentUrl\":\"https:\\/\\/philip.twinight.co\\/portfolio\\/wp-content\\/uploads\\/2024\\/03\\/FaultFinder.png\",\"width\":1920,\"height\":1080},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/2022\\\/11\\\/27\\\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/#website\",\"url\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/\",\"name\":\"Philip\u2019s University Data Science Journey\",\"description\":\"Navigating Data Science: From Classroom to Career\",\"publisher\":{\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/#\\\/schema\\\/person\\\/ef4f7cedd9b3bde11e126c4dbe1f8414\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/#\\\/schema\\\/person\\\/ef4f7cedd9b3bde11e126c4dbe1f8414\",\"name\":\"Philip\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\/\\/philip.twinight.co\\/portfolio\\/wp-content\\/uploads\\/2024\\/03\\/favicon.png\",\"url\":\"https:\\/\\/philip.twinight.co\\/portfolio\\/wp-content\\/uploads\\/2024\\/03\\/favicon.png\",\"contentUrl\":\"https:\\/\\/philip.twinight.co\\/portfolio\\/wp-content\\/uploads\\/2024\\/03\\/favicon.png\",\"width\":16,\"height\":16,\"caption\":\"Philip\"},\"logo\":{\"@id\":\"https:\\/\\/philip.twinight.co\\/portfolio\\/wp-content\\/uploads\\/2024\\/03\\/favicon.png\"},\"description\":\"Data Scientist &amp; Systems Engineer. Graduated from City University of Hong Kong. Previously founded Twinight Limited as CTO, developing AI investment analytics and automated trading solutions. Currently working as a Test and Integration Engineer on a Vessel Traffic Service (VTS) system in the maritime industry since December 2024.\",\"sameAs\":[\"https:\\\/\\\/philip.twinight.co\\\/portfolio\"],\"url\":\"https:\\\/\\\/philip.twinight.co\\\/portfolio\\\/index.php\\\/author\\\/philip\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates - Philip\u2019s Data Science Diary","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:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/","og_locale":"en_GB","og_type":"article","og_title":"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates - Philip\u2019s Data Science Diary","og_description":"This is the group project of SDSC3006 \u2013 Fundamentals of Machine Learning I. I did the project in my year 3 2022\/23 Semester A. Presentation Slides: Course Instructor: Prof. ZENG &hellip; Continue readingAutomating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates","og_url":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/","og_site_name":"Philip\u2019s Data Science Diary","article_published_time":"2022-11-27T12:59:00+00:00","article_modified_time":"2024-03-06T14:16:23+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/FaultFinder.png","type":"image\/png"}],"author":"Philip","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Philip","Estimated reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#article","isPartOf":{"@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/"},"author":{"name":"Philip","@id":"https:\/\/philip.twinight.co\/portfolio\/#\/schema\/person\/ef4f7cedd9b3bde11e126c4dbe1f8414"},"headline":"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates","datePublished":"2022-11-27T12:59:00+00:00","dateModified":"2024-03-06T14:16:23+00:00","mainEntityOfPage":{"@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/"},"wordCount":1045,"commentCount":1,"publisher":{"@id":"https:\/\/philip.twinight.co\/portfolio\/#\/schema\/person\/ef4f7cedd9b3bde11e126c4dbe1f8414"},"image":{"@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#primaryimage"},"thumbnailUrl":"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/FaultFinder.png","keywords":["2022\/23 Semester A","Data Science","Fundamentals of Machine Learning I","SDSC3006","Year 3"],"articleSection":["Machine Learning","Projects"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/","url":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/","name":"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates - Philip\u2019s Data Science Diary","isPartOf":{"@id":"https:\/\/philip.twinight.co\/portfolio\/#website"},"primaryImageOfPage":{"@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#primaryimage"},"image":{"@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#primaryimage"},"thumbnailUrl":"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/FaultFinder.png","datePublished":"2022-11-27T12:59:00+00:00","dateModified":"2024-03-06T14:16:23+00:00","breadcrumb":{"@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#primaryimage","url":"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/FaultFinder.png","contentUrl":"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/FaultFinder.png","width":1920,"height":1080},{"@type":"BreadcrumbList","@id":"https:\/\/philip.twinight.co\/portfolio\/index.php\/2022\/11\/27\/automating-quality-control-machine-learning-driven-classification-of-faults-in-steel-plates\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/philip.twinight.co\/portfolio\/"},{"@type":"ListItem","position":2,"name":"Automating Quality Control: Machine Learning-Driven Classification of Faults in Steel Plates"}]},{"@type":"WebSite","@id":"https:\/\/philip.twinight.co\/portfolio\/#website","url":"https:\/\/philip.twinight.co\/portfolio\/","name":"Philip\u2019s University Data Science Journey","description":"Navigating Data Science: From Classroom to Career","publisher":{"@id":"https:\/\/philip.twinight.co\/portfolio\/#\/schema\/person\/ef4f7cedd9b3bde11e126c4dbe1f8414"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/philip.twinight.co\/portfolio\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/philip.twinight.co\/portfolio\/#\/schema\/person\/ef4f7cedd9b3bde11e126c4dbe1f8414","name":"Philip","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/favicon.png","url":"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/favicon.png","contentUrl":"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/favicon.png","width":16,"height":16,"caption":"Philip"},"logo":{"@id":"https:\/\/mlcznkdztmb6.i.optimole.com\/w:auto\/h:auto\/q:mauto\/f:best\/ig:avif\/https:\/\/philip.twinight.co\/portfolio\/wp-content\/uploads\/2024\/03\/favicon.png"},"description":"Data Scientist &amp; Systems Engineer. Graduated from City University of Hong Kong. Previously founded Twinight Limited as CTO, developing AI investment analytics and automated trading solutions. Currently working as a Test and Integration Engineer on a Vessel Traffic Service (VTS) system in the maritime industry since December 2024.","sameAs":["https:\/\/philip.twinight.co\/portfolio"],"url":"https:\/\/philip.twinight.co\/portfolio\/index.php\/author\/philip\/"}]}},"_links":{"self":[{"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/posts\/373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/comments?post=373"}],"version-history":[{"count":4,"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/posts\/373\/revisions"}],"predecessor-version":[{"id":384,"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/posts\/373\/revisions\/384"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/media\/380"}],"wp:attachment":[{"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/media?parent=373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/categories?post=373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/philip.twinight.co\/portfolio\/index.php\/wp-json\/wp\/v2\/tags?post=373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}