Update app.py
Browse files
app.py
CHANGED
@@ -84,10 +84,31 @@ def update_neurons(activation, seed):
|
|
84 |
|
85 |
# Gradio Interface
|
86 |
with gr.Blocks() as demo:
|
87 |
-
# gr.Markdown("# Cholestrol Concentration Prediction- ANN and Linear Model")
|
88 |
gr.Markdown("# **Cholestrol Concentration Prediction Models (CCPM) - Linear and ANN Models**")
|
89 |
gr.Markdown("**Licence: Creative Commons Attribution Non Commercial Share Alike 4.0 cc-by-nc-sa-4.0**")
|
90 |
gr.Markdown("Dynamically select models and predict cholesterol concentration. For more information on dataset preparation and the associated experiment, kindly refer to and cite the journal article.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
|
92 |
gr.Markdown("This study presents Artificial Neural Networks (ANNs) and Linear Regression models for predicting cholesterol concentration from RGB colourimetric measurements. Around 2,500 single hidden layered ANN models, with varying activation functions, seed initialisations, and neuron counts were trained to approximate the non-linear relationship between colour channels and concentration levels. The trained models follow a 3-×-1 architecture with three input features (mean R, mean G, mean B), a single hidden layer of varying neurons, and one output neuron. A simple linear regression model was developed alongside as a baseline for comparison. The interface allows users to dynamically select the ANN model configuration and compare its predictions against the linear model. It also supports model selection, and performance evaluation for colour-based biosensing applications.")
|
93 |
|
@@ -111,29 +132,6 @@ Research Scholar, Department of Computer Science, School of Engineering and Tech
|
|
111 |
Professor, Centre for Nanoscience and Technology, Pondicherry University, Puducherry-605 014
|
112 |
[Web Page](http://www.pondiuni.edu.in/profile/dr-s-kannan)
|
113 |
""")
|
114 |
-
# gr.Markdown("Dynamically select models and predict cholesterol concentration.")
|
115 |
-
|
116 |
-
with gr.Row():
|
117 |
-
r = gr.Number(label="Mean R (0 -255)")
|
118 |
-
g = gr.Number(label="Mean G (0 -255)")
|
119 |
-
b = gr.Number(label="Mean B (0 -255)")
|
120 |
-
|
121 |
-
with gr.Row():
|
122 |
-
activation = gr.Dropdown(choices=activations, label="Activation Function", interactive=True)
|
123 |
-
seed = gr.Dropdown(choices=seeds, label="Seed", interactive=True)
|
124 |
-
neurons = gr.Dropdown(choices=neuron_list, label="Neurons", interactive=True)
|
125 |
-
|
126 |
-
activation.change(update_seeds, inputs=[activation], outputs=[seed])
|
127 |
-
seed.change(update_neurons, inputs=[activation, seed], outputs=[neurons])
|
128 |
-
|
129 |
-
with gr.Row():
|
130 |
-
btn = gr.Button("Predict")
|
131 |
-
|
132 |
-
with gr.Row():
|
133 |
-
ann_output = gr.Text(label="Cholestrol Conentration (mM) - ANN Model Prediction ")
|
134 |
-
lin_rgb_output = gr.Text(label="Cholestrol Conentration (mM) - Linear Model Prediction")
|
135 |
-
|
136 |
-
gr.Markdown("* Predicted negative concentration adjusted to zero.")
|
137 |
|
138 |
btn.click(
|
139 |
fn=predict,
|
|
|
84 |
|
85 |
# Gradio Interface
|
86 |
with gr.Blocks() as demo:
|
|
|
87 |
gr.Markdown("# **Cholestrol Concentration Prediction Models (CCPM) - Linear and ANN Models**")
|
88 |
gr.Markdown("**Licence: Creative Commons Attribution Non Commercial Share Alike 4.0 cc-by-nc-sa-4.0**")
|
89 |
gr.Markdown("Dynamically select models and predict cholesterol concentration. For more information on dataset preparation and the associated experiment, kindly refer to and cite the journal article.")
|
90 |
+
|
91 |
+
with gr.Row():
|
92 |
+
r = gr.Number(label="Mean R (0 -255)")
|
93 |
+
g = gr.Number(label="Mean G (0 -255)")
|
94 |
+
b = gr.Number(label="Mean B (0 -255)")
|
95 |
+
|
96 |
+
with gr.Row():
|
97 |
+
activation = gr.Dropdown(choices=activations, label="Activation Function", interactive=True)
|
98 |
+
seed = gr.Dropdown(choices=seeds, label="Seed", interactive=True)
|
99 |
+
neurons = gr.Dropdown(choices=neuron_list, label="Neurons", interactive=True)
|
100 |
+
|
101 |
+
activation.change(update_seeds, inputs=[activation], outputs=[seed])
|
102 |
+
seed.change(update_neurons, inputs=[activation, seed], outputs=[neurons])
|
103 |
+
|
104 |
+
with gr.Row():
|
105 |
+
btn = gr.Button("Predict")
|
106 |
+
|
107 |
+
with gr.Row():
|
108 |
+
ann_output = gr.Text(label="Cholestrol Conentration (mM) - ANN Model Prediction ")
|
109 |
+
lin_rgb_output = gr.Text(label="Cholestrol Conentration (mM) - Linear Model Prediction")
|
110 |
+
|
111 |
+
gr.Markdown("* Predicted negative concentration adjusted to zero.")
|
112 |
|
113 |
gr.Markdown("This study presents Artificial Neural Networks (ANNs) and Linear Regression models for predicting cholesterol concentration from RGB colourimetric measurements. Around 2,500 single hidden layered ANN models, with varying activation functions, seed initialisations, and neuron counts were trained to approximate the non-linear relationship between colour channels and concentration levels. The trained models follow a 3-×-1 architecture with three input features (mean R, mean G, mean B), a single hidden layer of varying neurons, and one output neuron. A simple linear regression model was developed alongside as a baseline for comparison. The interface allows users to dynamically select the ANN model configuration and compare its predictions against the linear model. It also supports model selection, and performance evaluation for colour-based biosensing applications.")
|
114 |
|
|
|
132 |
Professor, Centre for Nanoscience and Technology, Pondicherry University, Puducherry-605 014
|
133 |
[Web Page](http://www.pondiuni.edu.in/profile/dr-s-kannan)
|
134 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
135 |
|
136 |
btn.click(
|
137 |
fn=predict,
|