{"id":3519,"date":"2023-08-31T11:12:58","date_gmt":"2023-08-31T11:12:58","guid":{"rendered":"https:\/\/neuraldesigner.com\/learning\/qsar-biodegradation\/"},"modified":"2025-09-18T12:45:46","modified_gmt":"2025-09-18T10:45:46","slug":"qsar-biodegradation","status":"publish","type":"learning","link":"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/","title":{"rendered":"Predict chemical biodegradability with machine learning"},"content":{"rendered":"<p>This example aims to catalog different chemical biodegradability using machine learning.<\/p>\n<p>QSAR (Quantitative Structure-Activity Relationships) models are currently being developed more frequently.<\/p>\n<p>To construct the QSAR model, we leverage the explainable machine learning platform <a href=\"https:\/\/www.neuraldesigner.com\/\">Neural Designer<\/a>.<\/p>\n<p>For those interested in a hands-on experience, a <a href=\"https:\/\/www.neuraldesigner.com\/free-trial\">free trial<\/a> lets you meticulously follow the process.<\/p>\n<section>\n<h3>Contents<\/h3>\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 id=\"ApplicationType\">\n<h2>1. Application type<\/h2>\n<p>The variable to be predicted can have two values (ready or not ready biodegradable molecule).<\/p>\n<p>Thus, this is a binary <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-networks-applications#Classification\">classification<\/a> project. The goal here is to observe the correlation between different molecular descriptors and the biodegradability of a molecule.<\/p>\n<\/section>\n<section id=\"DataSet\">\n<h2>2. Data set<\/h2>\n<h3>Data source<\/h3>\n<p>The file <a href=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/10\/biodegradation.csv\">biodegradation.csv<\/a> contains 1055 samples of chemicals, each with 41 inputs, and one is a binary target.<\/p>\n<h3>Variables<\/h3>\n<p>This data set contains the following <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#Variables\">variables<\/a>:<\/p>\n<\/section>\n<h4>Constitutional descriptors<\/h4>\n<ul>\n<li data-start=\"179\" data-end=\"213\"><strong data-start=\"179\" data-end=\"186\">nHM<\/strong> \u2013 Number of heavy atoms.<\/li>\n<li data-start=\"216\" data-end=\"254\"><strong data-start=\"216\" data-end=\"222\">C%<\/strong> \u2013 Percentage of carbon atoms.<\/li>\n<li data-start=\"257\" data-end=\"303\"><strong data-start=\"257\" data-end=\"264\">nCp<\/strong> \u2013 Number of terminal primary C(sp\u00b3).<\/li>\n<li data-start=\"306\" data-end=\"340\"><strong data-start=\"306\" data-end=\"312\">nO<\/strong> \u2013 Number of oxygen atoms.<\/li>\n<li data-start=\"343\" data-end=\"379\"><strong data-start=\"343\" data-end=\"349\">nN<\/strong> \u2013 Number of nitrogen atoms.<\/li>\n<li data-start=\"382\" data-end=\"417\"><strong data-start=\"382\" data-end=\"388\">nX<\/strong> \u2013 Number of halogen atoms.<\/li>\n<\/ul>\n<h4>Topological descriptors<\/h4>\n<ul>\n<li data-start=\"460\" data-end=\"526\"><strong data-start=\"460\" data-end=\"472\">F01[N-N]<\/strong> \u2013 Frequency of N\u2013N bonds at topological distance 1.<\/li>\n<li data-start=\"529\" data-end=\"595\"><strong data-start=\"529\" data-end=\"541\">F02[C-N]<\/strong> \u2013 Frequency of C\u2013N bonds at topological distance 2.<\/li>\n<li data-start=\"598\" data-end=\"664\"><strong data-start=\"598\" data-end=\"610\">F03[C-N]<\/strong> \u2013 Frequency of C\u2013N bonds at topological distance 3.<\/li>\n<li data-start=\"667\" data-end=\"733\"><strong data-start=\"667\" data-end=\"679\">F04[C-N]<\/strong> \u2013 Frequency of C\u2013N bonds at topological distance 4.<\/li>\n<li data-start=\"736\" data-end=\"802\"><strong data-start=\"736\" data-end=\"748\">F03[C-O]<\/strong> \u2013 Frequency of C\u2013O bonds at topological distance 3.<\/li>\n<li data-start=\"805\" data-end=\"837\"><strong data-start=\"805\" data-end=\"813\">nCIR<\/strong> \u2013 Number of circuits.<\/li>\n<li data-start=\"840\" data-end=\"874\"><strong data-start=\"840\" data-end=\"847\">LOC<\/strong> \u2013 Lopping centric index.<\/li>\n<li data-start=\"877\" data-end=\"930\"><strong data-start=\"877\" data-end=\"886\">TI2_L<\/strong> \u2013 Second Mohar index from Laplace matrix.<\/li>\n<\/ul>\n<h4>Functional group descriptors<\/h4>\n<ul>\n<li data-start=\"978\" data-end=\"1023\"><strong data-start=\"978\" data-end=\"988\">NssssC<\/strong> \u2013 Number of atoms of type ssssC.<\/li>\n<li data-start=\"1026\" data-end=\"1075\"><strong data-start=\"1026\" data-end=\"1033\">nCb<\/strong> \u2013 Number of substituted benzene C(sp\u00b2).<\/li>\n<li data-start=\"1078\" data-end=\"1114\"><strong data-start=\"1078\" data-end=\"1086\">nN-N<\/strong> \u2013 Number of N hydrazines.<\/li>\n<li data-start=\"1117\" data-end=\"1164\"><strong data-start=\"1117\" data-end=\"1127\">nArNO2<\/strong> \u2013 Number of aromatic nitro groups.<\/li>\n<li data-start=\"1167\" data-end=\"1203\"><strong data-start=\"1167\" data-end=\"1176\">nCRX3<\/strong> \u2013 Number of CRX\u2083 groups.<\/li>\n<li data-start=\"1206\" data-end=\"1250\"><strong data-start=\"1206\" data-end=\"1214\">nCrt<\/strong> \u2013 Number of ring tertiary C(sp\u00b3).<\/li>\n<li data-start=\"1253\" data-end=\"1295\"><strong data-start=\"1253\" data-end=\"1264\">nArCOOR<\/strong> \u2013 Number of aromatic esters.<\/li>\n<li data-start=\"1298\" data-end=\"1351\"><strong data-start=\"1298\" data-end=\"1307\">nHDon<\/strong> \u2013 Number of H-bond donor atoms (N and O).<\/li>\n<li data-start=\"1354\" data-end=\"1405\"><strong data-start=\"1354\" data-end=\"1363\">C-026<\/strong> \u2013 Functional group descriptor (R\u2013CX\u2013R).<\/li>\n<li data-start=\"1408\" data-end=\"1474\"><strong data-start=\"1408\" data-end=\"1417\">N-073<\/strong> \u2013 Functional groups: Ar\u2082NH \/ Ar\u2083N \/ Ar\u2082N\u2013Al \/ R..N..R.<\/li>\n<li data-start=\"1477\" data-end=\"1534\"><strong data-start=\"1477\" data-end=\"1490\">B01[C-Br]<\/strong> \u2013 Presence\/absence of C\u2013Br at distance 1.<\/li>\n<li data-start=\"1537\" data-end=\"1594\"><strong data-start=\"1537\" data-end=\"1550\">B03[C-Cl]<\/strong> \u2013 Presence\/absence of C\u2013Cl at distance 3.<\/li>\n<li data-start=\"1597\" data-end=\"1654\"><strong data-start=\"1597\" data-end=\"1610\">B04[C-Br]<\/strong> \u2013 Presence\/absence of C\u2013Br at distance 4.<\/li>\n<\/ul>\n<h4>Electronic \/ E-State descriptors<\/h4>\n<ul>\n<li data-start=\"1706\" data-end=\"1741\"><strong data-start=\"1706\" data-end=\"1715\">SdssC<\/strong> \u2013 Sum of dssC E-states.<\/li>\n<li data-start=\"1744\" data-end=\"1775\"><strong data-start=\"1744\" data-end=\"1751\">SdO<\/strong> \u2013 Sum of dO E-states.<\/li>\n<li data-start=\"1778\" data-end=\"1848\"><strong data-start=\"1778\" data-end=\"1784\">Me<\/strong> \u2013 Mean atomic Sanderson electronegativity (scaled on carbon).<\/li>\n<li data-start=\"1851\" data-end=\"1913\"><strong data-start=\"1851\" data-end=\"1857\">Mi<\/strong> \u2013 Mean first ionization potential (scaled on carbon).<\/li>\n<\/ul>\n<h4>Spectral \/ Eigenvalue-based descriptors<\/h4>\n<ul>\n<li data-start=\"1972\" data-end=\"2027\"><strong data-start=\"1972\" data-end=\"1983\">SpMax_L<\/strong> \u2013 Leading eigenvalue from Laplace matrix.<\/li>\n<li data-start=\"2030\" data-end=\"2091\"><strong data-start=\"2030\" data-end=\"2039\">SM6_L<\/strong> \u2013 Spectral moment of order 6 from Laplace matrix.<\/li>\n<li data-start=\"2094\" data-end=\"2174\"><strong data-start=\"2094\" data-end=\"2105\">SpMax_A<\/strong> \u2013 Leading eigenvalue from adjacency matrix (Lov\u00e1sz\u2013Pelikan index).<\/li>\n<li data-start=\"2177\" data-end=\"2251\"><strong data-start=\"2177\" data-end=\"2191\">SpMax_B(m)<\/strong> \u2013 Leading eigenvalue from Burden matrix weighted by mass.<\/li>\n<li data-start=\"2254\" data-end=\"2334\"><strong data-start=\"2254\" data-end=\"2266\">SM6_B(m)<\/strong> \u2013 Spectral moment of order 6 from Burden matrix weighted by mass.<\/li>\n<li data-start=\"2337\" data-end=\"2421\"><strong data-start=\"2337\" data-end=\"2348\">J_Dz(e)<\/strong> \u2013 Balaban-like index from Barysz matrix weighted by electronegativity.<\/li>\n<li data-start=\"2424\" data-end=\"2508\"><strong data-start=\"2424\" data-end=\"2437\">HyWi_B(m)<\/strong> \u2013 Hyper-Wiener-like index (log) from Burden matrix weighted by mass.<\/li>\n<li data-start=\"2511\" data-end=\"2610\"><strong data-start=\"2511\" data-end=\"2526\">SpPosA_B(p)<\/strong> \u2013 Normalized spectral positive sum from Burden matrix weighted by polarizability.<\/li>\n<li data-start=\"2613\" data-end=\"2681\"><strong data-start=\"2613\" data-end=\"2625\">Psi_i_1d<\/strong> \u2013 Intrinsic state pseudoconnectivity index (type 1d).<\/li>\n<li data-start=\"2684\" data-end=\"2758\"><strong data-start=\"2684\" data-end=\"2695\">Psi_i_A<\/strong> \u2013 Intrinsic state pseudoconnectivity index (type S average).<\/li>\n<\/ul>\n<h4>Target variable<\/h4>\n<ul data-start=\"2791\" data-end=\"2900\">\n<li data-start=\"2791\" data-end=\"2900\">\n<p data-start=\"2793\" data-end=\"2831\"><strong data-start=\"2793\" data-end=\"2803\">RB_NRB<\/strong> \u2013 Biodegradability label:<\/p>\n<ul data-start=\"2834\" data-end=\"2900\">\n<li data-start=\"2834\" data-end=\"2863\">\n<p data-start=\"2836\" data-end=\"2863\"><em data-start=\"2836\" data-end=\"2861\">1 = ready biodegradable<\/em><\/p>\n<\/li>\n<li data-start=\"2866\" data-end=\"2900\">\n<p data-start=\"2868\" data-end=\"2900\"><em data-start=\"2868\" data-end=\"2897\">0 = not ready biodegradable<\/em>.<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<section id=\"DataSet\">\n<h3>Instances<\/h3>\n<p>Finally, the use of all <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#Instances\">instances<\/a> is set.<\/p>\n<p>Note that each instance contains a different chemical&#8217;s input and target variables.<\/p>\n<article class=\"text-token-text-primary w-full focus:outline-none scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]\" dir=\"auto\" tabindex=\"-1\" data-turn-id=\"request-68c14edc-00d8-832b-af79-36da58cd2575-18\" data-testid=\"conversation-turn-248\" data-scroll-anchor=\"true\" data-turn=\"assistant\">\n<div class=\"text-base my-auto mx-auto pb-10 [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\">\n<div class=\"[--thread-content-max-width:40rem] thread-sm:[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group\/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn\" tabindex=\"-1\">\n<div class=\"flex max-w-full flex-col grow\">\n<div class=\"min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;]:mt-5\" dir=\"auto\" data-message-author-role=\"assistant\" data-message-id=\"5e5d7dde-562f-442e-957e-6a7dca22ba08\" data-message-model-slug=\"gpt-5\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[3px]\">\n<div class=\"markdown prose dark:prose-invert w-full break-words light markdown-new-styling\">\n<p data-start=\"0\" data-end=\"72\" data-is-last-node=\"\" data-is-only-node=\"\">The dataset is split into 60% training, 20% validation, and 20% testing.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/article>\n<h3>Variables distributions<\/h3>\n<p>Also, we can calculate the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#Distributions\">distributions<\/a> for all variables.<\/p>\n<p>The figure below shows a pie chart of the dataset, comparing the proportion of biodegradable (positive) and non-biodegradable (negative) chemicals.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/biodegradation-pie-chart.webp\" \/><\/p>\n<article class=\"text-token-text-primary w-full focus:outline-none scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]\" dir=\"auto\" tabindex=\"-1\" data-turn-id=\"request-68c14edc-00d8-832b-af79-36da58cd2575-20\" data-testid=\"conversation-turn-252\" data-scroll-anchor=\"true\" data-turn=\"assistant\">\n<div class=\"text-base my-auto mx-auto pb-10 [--thread-content-margin:--spacing(4)] thread-sm:[--thread-content-margin:--spacing(6)] thread-lg:[--thread-content-margin:--spacing(16)] px-(--thread-content-margin)\">\n<div class=\"[--thread-content-max-width:40rem] thread-sm:[--thread-content-max-width:40rem] thread-lg:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group\/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn\" tabindex=\"-1\">\n<div class=\"flex max-w-full flex-col grow\">\n<div class=\"min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&amp;]:mt-5\" dir=\"auto\" data-message-author-role=\"assistant\" data-message-id=\"fe5bb2c7-a4fb-4498-9589-def544c299f0\" data-message-model-slug=\"gpt-5\">\n<div class=\"flex w-full flex-col gap-1 empty:hidden first:pt-[3px]\">\n<div class=\"markdown prose dark:prose-invert w-full break-words light markdown-new-styling\">\n<p data-start=\"0\" data-end=\"76\" data-is-last-node=\"\" data-is-only-node=\"\">As shown, 33.7% of the samples are biodegradable, while about 66.3% are not.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/article>\n<h3>Input-target correlations<\/h3>\n<p>Finally, the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/data-set#InputsTargetsCorrelations\">input-target correlations<\/a> might indicate which factors most influence biodegradability.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/biodegradation-inputs-target-correlation.webp\" \/><\/p>\n<p>The most correlated variables are <b>SpMax_B(m)<\/b>, <b>SM6_B(m)<\/b>, <b>SpMax_L,<\/b> and <b>SpMax_A<\/b>, whose descriptions are above.<\/p>\n<\/section>\n<section id=\"NeuralNetwork\">\n<h2>3. Neural network<\/h2>\n<p>The second step is to set a <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network\">neural network<\/a> representing the classification function. For this class of applications, the neural network is composed of:<\/p>\n<ul>\n<li>Scaling layer.<\/li>\n<li>Dense layer.<\/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> contains the statistics on the inputs calculated from the data file and the method for scaling the input variables.<\/p>\n<p>Here, the minimum and maximum methods have been set. Nevertheless, the mean and standard deviation method would produce very similar results.<\/p>\n<h3>Dense layer<\/h3>\n<p>For this example, we use a single <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/neural-network#PerceptronLayers\">dense layer<\/a>. This layer has 41 inputs and 1 neuron.<\/p>\n<p>Finally, we set the logistic activation function, as we want the predicted target variable\u00a0to be binary.<\/p>\n<\/section>\n<section id=\"TrainingStrategy\">\n<h2>4. Training strategy<\/h2>\n<p>The procedure used to carry out the learning process is called a <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy\">training strategy<\/a>.<\/p>\n<p>The training strategy is applied to the neural network to obtain the best possible performance.<\/p>\n<p>The type of training is determined by how the parameters in the neural network are adjusted.<\/p>\n<p>This process is composed of two terms:<\/p>\n<ul>\n<li>A loss index.<\/li>\n<li>An 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> is the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#MeanSquaredError\">mean squared error<\/a> with <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#L2Regularization\">L2 regularization<\/a>.\u00a0This is the default loss index for binary classification applications.\u00a0The learning problem can be stated as finding a neural network that minimizes the loss index.<\/p>\n<p>That is a neural network that fits the data set (<a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#ErrorTerm\">error term<\/a>) and does not oscillate (<a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#RegularizationTerm\">regularization term<\/a>).<\/p>\n<h3>Optimization algorithm<\/h3>\n<p>The <a style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); background-color: #ffffff;\" href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#OptimizationAlgorithm\">optimization algorithm<\/a> that we use is the <a style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-weight: var( --e-global-typography-text-font-weight ); background-color: #ffffff;\" href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/training-strategy#QuasiNewtonMethod\">quasi-Newton method<\/a>.\u00a0This is also the standard optimization algorithm for this type of problem.<\/p>\n<h3>Training<\/h3>\n<p>The following chart shows how errors decrease with the iterations during training.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/biodegradation-quasi-newton.webp\" \/><\/p>\n<p>The final training and selection errors are <b>training error = 0.108 WSE<\/b> and <b>selection error = 0.105 WSE<\/b>, respectively.<\/p>\n<\/section>\n<section id=\"ModelSelection\"><\/section>\n<section id=\"TestingAnalysis\">\n<h2>5. Testing analysis<\/h2>\n<p>The objective of the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/testing-analysis\">testing analysis<\/a> is to validate the generalization performance of the trained neural network.<\/p>\n<p>To validate a classification technique, we need to compare the values provided by this technique to the observed values.<\/p>\n<h3>ROC curve<\/h3>\n<p>We can use the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/testing-analysis#RocCurve\">ROC curve<\/a> as it is the standard testing method for binary classification projects.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.neuraldesigner.com\/images\/biodegradation-roc.webp\" \/><\/p>\n<h3>Confusion matrix<\/h3>\n<p>The following table contains the elements of the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/testing-analysis#ConfusionMatrix\">confusion matrix<\/a>.<\/p>\n<p>This matrix shows the number of negative and positive predicted values versus the real ones.<\/p>\n<table>\n<tbody>\n<tr>\n<th><\/th>\n<th>Predicted positive<\/th>\n<th>Predicted negative<\/th>\n<\/tr>\n<tr>\n<th>Real positive<\/th>\n<td style=\"text-align: right;\">59(28%)<\/td>\n<td style=\"text-align: right;\">14(6.6%)<\/td>\n<\/tr>\n<tr>\n<th>Real negative<\/th>\n<td style=\"text-align: right;\">15(7.1%)<\/td>\n<td style=\"text-align: right;\">123(58.3%)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>As we can see, the model correctly predicts 182 instances (86.3%) and misclassifies 29 (13.7%).<\/p>\n<p>Note that most of our chemical data indicate that they are not readily biodegradable.<\/p>\n<h3>Binary classification metrics<\/h3>\n<p>The <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/testing-analysis#BinaryClassificationTests\">binary classification tests<\/a> are parameters for measuring the performance of a classification problem with two classes:<\/p>\n<ul>\n<li><b>Accuracy<\/b> (ratio of instances correctly classified): 86.3%<\/li>\n<li><b>Error<\/b>\u00a0(ratio of instances misclassified): 13.7%<\/li>\n<li><b>Sensitivity<\/b> (ratio of real positives which the model predicts as positives): 86.3%<\/li>\n<li><b>Specificity<\/b> (ratio of real negatives which the model predicts as negatives): 86.2%<\/li>\n<\/ul>\n<\/section>\n<section id=\"ModelDeployment\">\n<h2>6. Model deployment<\/h2>\n<p>Once we test the neural network&#8217;s generalization performance, we can save the neural network for future use in the so-called <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/model-deployment\">model deployment<\/a> mode.<\/p>\n<p>We can predict whether a chemical molecule is biodegradable by calculating the <a href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/model-deployment#NeuralNetworkOutputs\">neural network outputs<\/a>.<\/p>\n<p>For that, we need to know the input variables for them.<\/p>\n<p>We can export the <a style=\"font-family: var( --e-global-typography-text-font-family ), Sans-serif; font-size: var( --e-global-typography-text-font-size ); font-weight: var( --e-global-typography-text-font-weight ); background-color: #ffffff;\" href=\"https:\/\/www.neuraldesigner.com\/learning\/tutorials\/model-deployment#MathematicalExpression\">mathematical expression<\/a> of the neural network, which takes input variables to produce output variables, specifically to predict biodegradability.<\/p>\n<p>This classification model propagates the information through the scaling, perceptron, and probabilistic layers.<\/p>\n<\/section>\n<h2>Conclusions<\/h2>\n<section id=\"ModelDeployment\">We have developed an algorithm that classifies the biodegradability of a chemical.<\/section>\n<section>\n<h2>References<\/h2>\n<ul>\n<li>We have obtained the data for this problem from the <a href=\"https:\/\/archive.ics.uci.edu\/ml\/datasets\/QSAR+biodegradation\">UCI Machine Learning Repository<\/a>.<\/li>\n<li>Mansouri, K., Ringsted, T., Ballabio, D., Todeschini, R., Consonni, V. (2013). Quantitative Structure-Activity Relationship models for ready biodegradability of chemicals. Journal of Chemical Information and Modeling, 53, 867-878.<\/li>\n<\/ul>\n<\/section>\n<section>\n<h2>Related posts<\/h2>\n<\/section>\n","protected":false},"author":13,"featured_media":2555,"template":"","categories":[29],"tags":[40,43],"class_list":["post-3519","learning","type-learning","status-publish","has-post-thumbnail","hentry","category-examples","tag-chemistry","tag-industry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Predict chemical biodegradability with machine learning<\/title>\n<meta name=\"description\" content=\"Build a machine learning model that predicts the biodegradability of molecules by analyzing their chemical structures and properties.\" \/>\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\/learning\/examples\/qsar-biodegradation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"QSAR Biodegradation machine learning example\" \/>\n<meta property=\"og:description\" content=\"This example aims to catalog different chemicals depending on whether they are biodegradable or not. QSAR (Quantitative Structure Activity Relationships) models are currently being developed with more frequency nowadays.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/\" \/>\n<meta property=\"og:site_name\" content=\"Neural Designer\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-18T10:45:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp\" \/>\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\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"QSAR Biodegradation machine learning example\" \/>\n<meta name=\"twitter:description\" content=\"This example aims to catalog different chemicals depending on whether they are biodegradable or not. QSAR (Quantitative Structure Activity Relationships) models are currently being developed with more frequency nowadays.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp\" \/>\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\/learning\/examples\/qsar-biodegradation\/\",\"url\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/\",\"name\":\"Predict chemical biodegradability with machine learning\",\"isPartOf\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp\",\"datePublished\":\"2023-08-31T11:12:58+00:00\",\"dateModified\":\"2025-09-18T10:45:46+00:00\",\"description\":\"Build a machine learning model that predicts the biodegradability of molecules by analyzing their chemical structures and properties.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#primaryimage\",\"url\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp\",\"contentUrl\":\"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp\",\"width\":1200,\"height\":628},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.neuraldesigner.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learning\",\"item\":\"https:\/\/www.neuraldesigner.com\/learning\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Predict chemical biodegradability with 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":"Predict chemical biodegradability with machine learning","description":"Build a machine learning model that predicts the biodegradability of molecules by analyzing their chemical structures and properties.","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\/learning\/examples\/qsar-biodegradation\/","og_locale":"en_US","og_type":"article","og_title":"QSAR Biodegradation machine learning example","og_description":"This example aims to catalog different chemicals depending on whether they are biodegradable or not. QSAR (Quantitative Structure Activity Relationships) models are currently being developed with more frequency nowadays.","og_url":"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/","og_site_name":"Neural Designer","article_modified_time":"2025-09-18T10:45:46+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_title":"QSAR Biodegradation machine learning example","twitter_description":"This example aims to catalog different chemicals depending on whether they are biodegradable or not. QSAR (Quantitative Structure Activity Relationships) models are currently being developed with more frequency nowadays.","twitter_image":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp","twitter_site":"@NeuralDesigner","twitter_misc":{"Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/","url":"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/","name":"Predict chemical biodegradability with machine learning","isPartOf":{"@id":"https:\/\/www.neuraldesigner.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#primaryimage"},"image":{"@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#primaryimage"},"thumbnailUrl":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp","datePublished":"2023-08-31T11:12:58+00:00","dateModified":"2025-09-18T10:45:46+00:00","description":"Build a machine learning model that predicts the biodegradability of molecules by analyzing their chemical structures and properties.","breadcrumb":{"@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#primaryimage","url":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp","contentUrl":"https:\/\/www.neuraldesigner.com\/wp-content\/uploads\/2023\/06\/biodegradation-example.webp","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/www.neuraldesigner.com\/learning\/examples\/qsar-biodegradation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.neuraldesigner.com\/"},{"@type":"ListItem","position":2,"name":"Learning","item":"https:\/\/www.neuraldesigner.com\/learning\/"},{"@type":"ListItem","position":3,"name":"Predict chemical biodegradability with 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\/learning\/3519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/learning"}],"about":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/types\/learning"}],"author":[{"embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/users\/13"}],"version-history":[{"count":0,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/learning\/3519\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/media\/2555"}],"wp:attachment":[{"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/media?parent=3519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/categories?post=3519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.neuraldesigner.com\/api\/wp\/v2\/tags?post=3519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}