<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tenzin Migmar on Medium]]></title>
        <description><![CDATA[Stories by Tenzin Migmar on Medium]]></description>
        <link>https://medium.com/@tenzin-migmarr?source=rss-37529e2ae723------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0QcuBDZ6FT00FDV5dNxyjg.png</url>
            <title>Stories by Tenzin Migmar on Medium</title>
            <link>https://medium.com/@tenzin-migmarr?source=rss-37529e2ae723------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 16:40:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tenzin-migmarr/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Galaxy Multi-Image Classification with LeNet-5]]></title>
            <link>https://medium.com/data-science/galaxy-multi-image-classification-with-lenet-5-1bc2f66d3cfc?source=rss-37529e2ae723------2</link>
            <guid isPermaLink="false">https://medium.com/p/1bc2f66d3cfc</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[image-classification]]></category>
            <category><![CDATA[galaxy]]></category>
            <dc:creator><![CDATA[Tenzin Migmar]]></dc:creator>
            <pubDate>Thu, 20 May 2021 14:47:08 GMT</pubDate>
            <atom:updated>2021-05-25T23:08:59.630Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*0XJWFzhNfULkEMFo" /><figcaption>Photo by <a href="https://unsplash.com/@gferla">Guillermo Ferla</a> on Unsplash.</figcaption></figure><h4>Exploring Space with Gradient Descent Magic</h4><p>The beauty of galaxies never ceases to overwhelm me. It’s incredibly grounding to ruminate about galaxies and they’re a powerful tool for reshaping perspectives.</p><p>A while back as I was scouring the internet for my next machine learning adventure, I stumbled upon <a href="https://astronn.readthedocs.io/en/latest/galaxy10.html">this</a> one and knew that I had to give it a shot. Before training a machine to classify the images though, I was curious, how well could <em>I </em>sort them?</p><p>The short answer is not very well. Some of them were quite obvious and I could easily pluck them out and categorize them as a specific label. Others I would be confident in, only to have my confidence shattered when I found out I was wrong.</p><p>With this in mind, I was now curious. How well would a machine do? So I put the question to the test and built a convolutional neural network — which one exactly? The beloved LeNet-5!</p><p>In this article, I’ll walk through start to finish how to build a machine learning model that classifies galaxies!</p><p>Only interested in the code? That’s okay, I’m not too offended. I’ll save you the hassle of reading through the entire article because to be honest, I’m not the biggest fan of wading through large amounts of information when I only need a specific piece of it too. Here’s the link to the <a href="https://www.kaggle.com/tenzinmigmar/classifying-iris-flower-types-with-k-means">Kaggle</a> Notebook.</p><h4>Importing Dependencies</h4><p>The first thing to do when working when building any machine learning model is to download the dependencies we’ll need.</p><pre>! pip install astroNN<br>import tensorflow as tf<br>import matplotlib.pyplot as plt<br>import pandas as pd<br>import seaborn as sns<br>import numpy as np<br>from tensorflow import keras<br><br>from keras.models import Sequential<br>from keras.layers import Conv2D, AveragePooling2D, Flatten, Dense, Dropout<br>from keras.callbacks import ReduceLROnPlateau<br>from keras.optimizers import Adam<br><br>import sklearn<br>from sklearn.model_selection import train_test_split<br>from sklearn.metrics import classification_report,confusion_matrix<br>from tensorflow.keras import utils<br><br>from astroNN.datasets import galaxy10<br>from astroNN.datasets.galaxy10 import galaxy10cls_lookup</pre><p>With that done, we now have the tools needed to start building our model.</p><h4>About the Dataset</h4><p>If you’ve read any of my other machine learning articles, you’ll know how highly I think of data. Data points are the north star to our everyday decisions. Know that your co-worker always hogs the coffee machine at 10 am? You’ll restructure your coffee break to be 9:30 instead. Constantly frustrated that your teacher likes to surprise you with pop quizzes? You’ll start studying every day to be prepared for whatever they could possibly throw your way the next day.</p><p>Data is the core of machine learning. If artificial intelligence had a slogan, I’d say it’d be “just add data”. That being said, let me give you a short introduction to the star of today’s show: galaxy10!</p><p>The galaxy10 dataset is a dataset that contains 21785 69x69 pixels coloured galaxy images with 10 different classes. The images from this dataset come from Sloan Digital Sky Survey and the labels come from Galaxy Zoo.</p><p>Each of the images within the dataset is classified under one of the 10 classes, however, there were discrepancies in the classes assigned to certain images from the human volunteers who were tasked with labelling the images which serve as empirical evidence that there is a high level of similarity in the images between the classes. To mitigate this issue, the Galaxy10 dataset does not include images where there was no definitive decision. (55% of votes cast by human volunteers towards one class)</p><p>You’ve now been acquainted with the dataset! Let’s move on.</p><h4>Data Exploration</h4><p>Now, we can’t explore data that hasn’t been loaded in yet.</p><pre>images, labels = galaxy10.load_data()<br><br>x_train, x_test, y_train, y_test = train_test_split(images, labels, test_size=0.2)<br><br>features = [&#39;Disk, Face-on, No Spiral&#39;, &#39;Smooth, Completely round&#39;, &#39;Smooth, in-between round&#39;, &#39;Smooth, Cigar shaped&#39;, &#39;Disk, Edge-on, Rounded Bulge&#39;, &#39;Disk, Edge-on, Boxy Bulge&#39;, <br>            &#39;Disk, Edge-on, No Bulge&#39;,&#39;Disk, Face-on, Tight Spiral&#39;, &#39;Disk, Face-on, Medium Spiral&#39;, &#39;Disk, Face-on, Loose Spiral&#39;]<br><br>x_train = x_train / 255.0<br>x_test = x_test / 255.0</pre><p>That’s better. Now, let’s try to understand the data a bit better.</p><pre>x_train.shape, x_test.shape</pre><pre># This prints ((17428, 69, 69, 3), (4357, 69, 69, 3))</pre><p>Now, we know a bit more about our dataset. Here, we have a dataset of 17248 coloured training images with dimensions of 69 by 69 and 4357 coloured testing images with dimensions of 69 by 69. Let’s take a look at a random selection of images within our dataset.</p><pre>fig = plt.figure(figsize=(20,20)) <br><br>for i <strong>in</strong> range(25):<br>    plt.subplot(5,5,i+1)    <br>    plt.imshow(x_train[i])<br>    plt.title(features[y_train[i]])<br>    fig.tight_layout(pad=3.0)<br>    <br>plt.show()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*MQNB-MYMLcrnokXBDsEScg.png" /><figcaption>Selection of galaxy images from dataset. Images from galaxy10 dataset.</figcaption></figure><p>Awe-inspiring aren’t they? Let’s see what else we can uncover about this dataset.</p><pre><em># Check class distribution</em><br><br>df = pd.DataFrame(data=labels)<br><br>counts = df.value_counts().sort_index()<br>print(counts)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*gOK2EPmIjfEewuOSx0-zLw.png" /><figcaption>The output of the above code. Image by the author.</figcaption></figure><pre>def class_distribution(x, y, labels):<br>    fig, ax = plt.subplots()<br>    ax.bar(x, y)<br>    ax.set_xticklabels(labels, rotation=90)<br>    plt.show()<br>    <br>class_distribution(features, counts, features)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*dPFD29i5BvNb-5pAY7KfBA.png" /><figcaption>The output of the above code. Image by the author.</figcaption></figure><h4>Imbalanced Data: The Accuracy Paradox</h4><p>Here, we have quite an unbalanced dataset. The number of images in each class range from 17 (min) in class 5 and 6997 (max) in class 1. The issue with data that has skewed class distributions is that accuracy is no longer an evaluation metric that correctly reflects the machine learning model’s ability to classify the images. This is also known as the <strong>accuracy paradox</strong> which states that a model with a higher accuracy might have less predictive power than a model with lower accuracy.</p><p>To sum it up: accuracy may not always be the best metric to evaluate your model. As a result, it would be a more fair analysis if we used other evaluation metrics like precision or recall.</p><p><strong>Precision</strong>: Precision = True Positive (TP) / True Positive (TP) + False Positive (FP)</p><p><strong>Recall</strong>: Recall = True Positive (TP) / True Positive (TP) + False Negative (FN)</p><p><strong>Side note:</strong> Precision and recall metrics have been removed so we’ll train the convolutional nets with accuracy as the metric but use Scikit Learn’s classification report later on to gain a better understanding of our model’s precision, recall, and f1 score.</p><h4>Training the Baseline Model</h4><pre>model = Sequential()<br><br><em># Baseline model to compare to LeNet-5</em><br>model.add(Flatten(input_shape=(69, 69, 3)))<br>model.add(Dense(128, activation=&#39;relu&#39;))<br>model.add(Dense(10, activation=&#39;softmax&#39;))<br><br>model_optimizer = Adam(lr=0.001)<br><br>model.compile(optimizer=model_optimizer, loss=&#39;sparse_categorical_crossentropy&#39;, metrics=[&quot;accuracy&quot;])<br>reduceLR = ReduceLROnPlateau(monitor=&#39;accuracy&#39;, factor=.001, patience=1, min_delta=0.01, mode=&quot;auto&quot;)<br>lol = model.fit(x_train, y_train, epochs=10, callbacks=[reduceLR])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*SAdDfxyYLYIXpHVQGtJsLw.png" /><figcaption>The output of the above code. Image by the author.</figcaption></figure><p>Not bad. A final accuracy of 70%. Let’s see how LeNet-5 does in comparison, but before we do that, let me introduce to you the background of LeNet-5.</p><h4>The LeNet-5 Architecture</h4><p>The LeNet-5 is an old but classic convolutional neural network architecture developed in 1998 by Yann Andre LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. When first developed, it was designed for handwritten MNIST digits recognition and became the foundation for future architectures like AlexNet and VGG.</p><p>The first convolution block consists of two convolutional and average pooling layers which are succeeded by a flatten layer and then followed by 3 dense layers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*utJ5tWibo6-k17ZR.png" /><figcaption>The LeNet-5 architecture. The figure can be found in the <a href="http://yann.lecun.com/exdb/publis/pdf/lecun-01a.pdf">original paper.</a></figcaption></figure><p>Let’s start building the LeNet-5 model!</p><pre>model2 = Sequential()<br><br><em># LeNet-5 conv-net architecture</em><br>model2.add(Conv2D(filters=6, kernel_size=(5,5), strides=(1,1), activation=&#39;tanh&#39;, input_shape=(69,69,3)))<br>model2.add(AveragePooling2D(pool_size=(2,2), strides=(2,2)))<br>model2.add(Conv2D(filters=16, kernel_size=(5,5), strides=(1,1), activation=&#39;tanh&#39;))<br>model2.add(AveragePooling2D(pool_size=(2,2), strides=(2,2)))<br><br>model2.add(Flatten())<br>model2.add(Dense(units=120, activation=&#39;tanh&#39;))<br>model2.add(Dense(units=84, activation=&#39;tanh&#39;))<br>model2.add(Dense(units=10, activation=&#39;softmax&#39;))<br><br>model_optimizer = Adam(lr=0.001)<br><br>reduceLR = ReduceLROnPlateau(monitor=&#39;accuracy&#39;, factor=.001, patience=1, min_delta=0.01, mode=&quot;auto&quot;)<br><br>model2.compile(optimizer=model_optimizer, loss=&#39;sparse_categorical_crossentropy&#39;, metrics=[&quot;accuracy&quot;])<br>model2.fit(x_train, y_train, epochs=10, callbacks=[reduceLR])</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*MuLcTOpWrtjHzHfKS-2c3A.png" /><figcaption>The output of the code above. Image by the author.</figcaption></figure><p>90% accuracy! Not exactly the holy grail of machine learning but a respectable score. Now, let’s see the predictions of our LeNet-5 model.</p><pre>predict = model2.predict(x_test).argmax(axis=1)<br><br>for i <strong>in</strong> range(10):<br>    print(&quot;Actual:&quot;, features[y_test[i]])<br>    print(&quot;Prediction:&quot;, features[np.argmax(predict[i])])<br>    print(&quot;-----&quot;)<br>    print()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/1*hKbETLMxTklSkSoAgdEF4A.png" /><figcaption>The output of the code above. Image by the author.</figcaption></figure><p>It looks like some of the galaxy classes are being confused for others. It’s difficult for even humans to correctly classify each of the image classes. To gain a better understanding of the mistakes made, using confusion matrixes are helpful. We’ll also be taking a look at the classification report here.</p><pre>classification_report(y_test, predict)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/1*sqGvMVX0cH7Rz8WtL84M6A.png" /><figcaption>The output of the code above. Image by the author.</figcaption></figure><p>From this report, we can tell that our model has high precision and recall for classifying classes 0, 1, 2, 4 (specifically 1 and 2). Notice how classes 1 and 2 also had the most training and testing samples too. On the other end of the spectrum, the model has very low precision and recall (0) for class 5 where there were only 6 testing samples. Plotting a confusion matrix will provide further transparency on what those 6 testing samples were predicted as.</p><pre>matrix = confusion_matrix(y_test, predict)<br>sns.heatmap(matrix, annot=True)<br>plt.title(&#39;Galaxy Confusion Matrix&#39;)<br>plt.xlabel(&#39;Predicted class&#39;)<br>plt.ylabel(&#39;True class&#39;)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*ZRkcErAyU3gbwlSJROrZlA.png" /></figure><p>The model did well with predicting class 1 and 2 images! Not surprising since they’re the classes with the most samples. 0 and 4 didn’t do too bad either. Our model consistently confused class 0 for class 7 (76 samples), class 1 and 2 were also frequently predicted for class 0. Also, the model had issues with classifying class 8, often mistaking it with classes 0 and 7. Let’s look into that. Class 8 is the Disk, Face-on, Medium Spiral, class 0 is Disk, Face-on, No Spiral, and class 7 is Disk, Face-on, Tight Spiral. Taking a look at the images visualized above, it’s quite easy to discern why these images look quite similar.</p><h4>Conclusion</h4><p>This was an interesting dataset to toy around with! When I’d found it and examined the images, it’d been difficult for me as a human to discern between the differences of the different galaxy classes as they shared highly similar characteristics, so I was intrigued to see how a machine learning model would perform in comparison to a human. Some of the initial assumptions I’d made were right: I’d believed that the model would have the most difficulty with the spirals, others were a little off. I had thought that the model would confuse classes 1 and 2 (Smooth, Completely round and Smooth, in-between round) more often as those classes also looked very similar in some images. After training, I would attribute the model’s ability to discern between the two classes so well due to the fact that it had a large number of images for each class to train on.</p><p>Other things to note: accuracy isn’t always the best metric to evaluate your model and also a side note for LeNet-5; LeNet-5 while it may be relatively old of architecture, it didn’t perform too poorly on this dataset.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1bc2f66d3cfc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/galaxy-multi-image-classification-with-lenet-5-1bc2f66d3cfc">Galaxy Multi-Image Classification with LeNet-5</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Classifying Iris Species with K-Means Clustering]]></title>
            <link>https://tenzin-migmarr.medium.com/classifying-iris-species-with-k-means-clustering-c5a49fc4180b?source=rss-37529e2ae723------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5a49fc4180b</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[k-means-clustering]]></category>
            <category><![CDATA[dataset]]></category>
            <dc:creator><![CDATA[Tenzin Migmar]]></dc:creator>
            <pubDate>Thu, 20 May 2021 04:10:41 GMT</pubDate>
            <atom:updated>2021-05-20T04:10:41.384Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*toBNWCoaOuD9hEvO" /><figcaption>Image by <a href="https://unsplash.com/@cbrin">Christina Brinza</a> on Unsplash.</figcaption></figure><h4>Implementing the K-Means Clustering Algorithm on the Iris Dataset</h4><p>If you’re anything like me, you might have spent the past couple of months diving into the realm of neural networks only to submerge from the depths of deep learning and realize you’ve neglected classical machine learning by casting it aside.</p><p>Although a lot of cutting-edge artificial intelligence research puts the limelight on deep learning, classical machine learning algorithms like support vector machines and logistic regression also have a lot to offer.</p><p>In this article, I’ll walk through one of the most popular algorithms: K-Means Clustering and step through how you can implement it on one of machine learning’s “hello world!” datasets: the iconic Iris dataset.</p><p>I’ve always been a strong believer in putting the spotlight on the data. Data is the backbone to artificial intelligence and in keeping up with appearances, I’ll quickly give a short introduction to the beloved Iris dataset.</p><p>Only interested in the code? That’s okay, I’m not too offended. I’ll save you the hassle of reading through the entire article because to be honest, I’m not the biggest fan of wading through large amounts of information when I only need a specific piece of it too. Here’s the link to the <a href="https://www.kaggle.com/tenzinmigmar/classifying-iris-flower-types-with-k-means">Kaggle</a> Notebook.</p><p>The Iris flower dataset is a multiclassification problem first introduced by British statistician and biologist Ronald Fisher which lies in classifying three variations of an Iris — Iris Setosa, Iris Virginica, and Iris Versicolor. The features for this dataset are the length and width of the petals and sepals and the target class of the species. (If I’ve already convinced you to give this dataset a go, you can find it <a href="https://www.kaggle.com/arshid/iris-flower-dataset">here</a>, otherwise, hang tight and give me a couple more paragraphs and you might find yourself scrolling back up.)</p><p>With that dataset knowledge, let’s begin data exploration to see what golden nuggets of information we can uncover about this dataset.</p><pre>import pandas as pd<br>import matplotlib.pyplot as plt<br>import seaborn as sns<br>import numpy as np <br>from sklearn.cluster import KMeans <br><br>df = pd.read_csv(&quot;../input/iris-flower-dataset/IRIS.csv&quot;)<br><br><em># First look at the dataset table </em></pre><pre>df.head(5)</pre><p>This should reveal to you a table of the first 5 values of the dataset. Take a look. You likely won’t find anything too interesting about it. Only some columns and rows of numbers that don’t have much meaning just yet.</p><pre><em># Shape of data, # of samples working with</em><br><br>df.shape</pre><p>Pretty self-explanatory! Df.shape will fill us in on how many rows and columns we’re dealing with. In this case, we have 150 rows and 5 columns.</p><pre><em># Useful info like mean, min, max for features</em><br><br>df.describe()</pre><p>Then, we’ll use .describe() to draw out useful information. Again, this is quite simple so I’ll drop the code for the next bit and move on to explaining the K-Means Clustering algorithm.</p><pre><em># Finding null values</em><br><br>df.isna().sum()</pre><pre><em># Plot distributions against features</em><br><br>colors = {&quot;Iris-virginica&quot;:&quot;purple&quot;, &quot;Iris-setosa&quot;: &quot;blue&quot;, &quot;Iris-versicolor&quot;:&quot;green&quot;}<br><br>def showDistributions(feature1):<br>    plt.figure(figsize=(30,30))<br>    plt.subplot(6,6,1)<br>    plt.scatter(df[feature1], df[&#39;species&#39;], c=df[&#39;species&#39;].map(colors))<br>    plt.title(&quot;<strong>{}</strong> distribution&quot;.format(feature1))<br>    plt.xlabel(feature1)<br>    plt.ylabel(&#39;species&#39;)<br>    plt.show()<br>    <br>showDistributions(&#39;sepal_length&#39;)<br>showDistributions(&#39;petal_length&#39;)<br>showDistributions(&#39;sepal_width&#39;)<br>showDistributions(&#39;petal_width&#39;)</pre><h4>What is the K-Means Clustering Algorithm?</h4><p>K-Means clustering is an unsupervised classical machine learning algorithm that classifies targets by clusters of aggregated datapoints resulting from certain similarities within the features. As mentioned, K-Means is an unsupervised algorithm hence the model will be trying to understand the data and draw out valuable or informative features and reveal patterns within the dataset.</p><p><strong>How K-Means Clustering works:</strong> The K in K-Means clustering is actually a variable that stands for the number of centroids — points at the center of clusters. Beginning with initialization, K-Means calculates the distances between the data points and the number of centroids (<em>k</em>), and then groups each data point under the centroid that it is closest to.</p><p>Then, the centroid is recalculated, the formula for the new centroids are as follows:</p><blockquote><em>sum of points grouped to centroid / # of points in group</em></blockquote><p>This process continues until all data points are grouped into their respective clusters and there are no changes in the classes of any of the data points.</p><p>With the intuition behind how the K-Means Clustering Algorithm now under our belt, let’s build the model.</p><pre># creating our target and prediction values </pre><pre>x = df.drop([&#39;species&#39;], axis=1)<br>y = df[&#39;species&#39;]</pre><pre>from sklearn.cluster import KMeans<br><br>kmeans = KMeans(n_clusters = 3, init = &#39;k-means++&#39;, max_iter = 500, n_init = 10, random_state = 0)<br>model = kmeans.fit_predict(x)</pre><pre><em># Looking at the centroid values generated</em><br><br>kmeans.cluster_centers_</pre><p>We can then gauge the performance of the model by comparing the predicted and actual target values.</p><pre>species = {&quot;Iris-versicolor&quot;: 0, &quot;Iris-setosa&quot;: 1, &quot;Iris-virginica&quot;: 2}<br><br>irisdf = df.copy()<br><br>irisdf[&quot;species&quot;] = irisdf[&quot;species&quot;].map(species)<br>irisdf[&quot;predicted&quot;] = model</pre><pre>irisdf</pre><h4>Closing Notes</h4><p>This is a pretty standard dataset. Not too interesting or too many patterns or insights to extract because it only has 4 features, none of which are too unique from the others. It was nice to be able to reacquaint myself with K-Means clustering though! I’m looking forward to implementing more classical machine learning algorithms on some other datasets.</p><p>Check out some of my other notebooks!</p><p><a href="http://www.kaggle.com/tenzinmigmar/lunar-rocky-landscape-segmentation-with-u-net">Lunar Rocky Landscape Segmentation with U-Net</a></p><p><a href="http://www.kaggle.com/tenzinmigmar/fashion-mnist">Designing Convolutional Neural Networks with Fashion MNIST</a></p><p><a href="https://www.kaggle.com/tenzinmigmar/galaxy-multi-image-classification-with-lenet-5">Galaxy Multi-Image Classification with LeNet-5</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5a49fc4180b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extracting Air Quality Insights with Data Exploration and Visualization]]></title>
            <link>https://tenzin-migmarr.medium.com/extracting-air-quality-insights-with-data-exploration-and-visualization-72751b1f64d0?source=rss-37529e2ae723------2</link>
            <guid isPermaLink="false">https://medium.com/p/72751b1f64d0</guid>
            <category><![CDATA[air-quality]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Tenzin Migmar]]></dc:creator>
            <pubDate>Sun, 11 Apr 2021 21:31:25 GMT</pubDate>
            <atom:updated>2021-04-12T21:17:59.849Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gXrAkLcZ6cJD27qt" /><figcaption>Image by Braden Collum on <a href="https://unsplash.com/photos/75XHJzEIeUc">Unsplash</a>.</figcaption></figure><h4>Analyzing air quality trends through responses from an air quality multi-sensor device located in a city in Italy</h4><p>The human need of air is a constant condition until death. Living beings rely on the respiration process; the intake of oxygen fuels our cells, breaks down the food we eat into energy, kills bacteria, etc.</p><p>That being said, it goes without saying that the <em>quality</em> of air we breathe is also critical to our health and well-being. Air ridden with pollutants can be detrimental to our health. Upon intake, the air travels through our bloodstream and could expose key internal organs to pollutants. With increased anthropogenic activities both from mobile sources like operating vehicles, buses, and other modes of transportation and stationary sources like power plants, industrial facilities, factories emitting air pollutants like Ozone (at ground level; O3), Nitrogen Oxides (NOx), Carbon Monoxide (CO), Sulfur Dioxide (S02), and Particulate matter (PM10, PM2.5) which can cause long-term impacts on health. The statistics behind air pollution are enough to provide clear insight into the scale of this issue: according to <a href="https://www.who.int/news-room/air-pollution#:~:text=Air%20pollution%20levels%20remain%20dangerously,from%20exposure%20to%20polluted%20air.">data</a> from the World Health Organization, <em>nine out of ten</em> people around the world are breathing air with high quantities of air pollutants, every year, <a href="https://www.who.int/health-topics/air-pollution#tab=tab_1"><em>seven</em> million deaths </a>are caused by exposure to outdoor and indoor air pollution and air pollution is linked to strokes, heart diseases, cancers and both chronic and acute respiratory diseases.</p><p>The air we breathe is the fuel to the engine that is our body, but if that fuel is knocking off years from life spans and increasing risk of diseases and health conditions, it becomes inimical to our best interests. Using a data visualization-based approach to draw out trends hourly air quality concentrations of Carbon Monoxide, Sulfur Dioxide, ground level Ozone, etc can mitigate the impact these harmful pollutants have on health by providing us with key insights into how external factors contribute to increases and decreases to air quality in our environment.</p><p>In this article, I’ll be drawing out trends through analyzing air quality collected from in an undisclosed city in Italy. Values were collected as responses from a gas multi sensor device deployed at ground level. Prior to data visualizations and creating conclusions, I’ll run through the dataset’s attributes to provide additional context. For the dataset I worked with which you can find here, there were 16 attributes.</p><p>Date and time; self-explanatory in dd/mm/yyyy and hh/mm/ss format to represent the date and time of the responses. True hourly concentration CO in mg/m³ (reference analyzer); CO also stands for Carbon Monoxide; an gas that’s difficult to be picked up by the senses due to its lack of colour, taste, and smell. Carbon Monoxide can be found in the Earth’s atmosphere but at very low concentrations and is naturally formed through combustion. Sources of outdoor Carbon Monoxide are cars, trucks, trains, vehicles or other human activities that burn fossil fuels. PT08.S1 (tin oxide) hourly averaged sensor response; tin oxide is created by burning tin metal (nominally CO targeted). <a href="https://www.nap.edu/read/10378/chapter/3#:~:text=Carbon%20monoxide%20(CO)%E2%80%94a,United%20States%20is%20vehicle%20emissions.">[1]</a></p><p>True hourly averaged overall Non-Metanic HydroCarbons concentration in microg/m³ (reference analyzer); gases such as ethane, ethene, propane, propene, and isoprene are encompassed under NMHCs. Non-Metanic HydroCarbons are naturally released through sources such as fossil carbon depositis, volcanic activity and wildfires, however, anthropogenic activities such as biomass burning and industrial emissions are also causes. <a href="https://www.sciencedaily.com/releases/2016/06/160614100242.htm">[2]</a> True hourly averaged Benzene concentration in microg/m³ (reference analyzer); Benzene can be found in quantities in outdoor air to due emissions from tobacco smoke, gas stations, motor vehicle exhaust, and industrial activities. <a href="https://emergency.cdc.gov/agent/benzene/basics/facts.asp#:~:text=Outdoor%20air%20contains%20low%20levels,than%20those%20in%20outdoor%20air.&amp;text=A%20major%20source%20of%20benzene%20exposure%20is%20tobacco%20smoke.">[3]</a></p><p>PT08.S2 (titania) hourly averaged sensor response (nominally NMHC targeted), true hourly averaged NOx concentration in ppb (reference analyzer); NOx or Nitrogen Oxides are a branch of poisonous, highly reactive gases. Nitrogen Oxide gases encourage the formation of smog and acid rain as well as play a role in influencing tropospheric ozone. <a href="https://www.myvehicle.ie/car-news/vrt-nox-emissions">[4]</a> Nitrogen Oxide is formed through the reaction of Nitrogen and Oxygen gases and is released from sources such as vehicle emissions. <a href="https://www3.epa.gov/region1/airquality/nox.html#:~:text=Nitrogen%20Oxides%20(NOx)%20Control%20Regulations&amp;text=Nitrogen%20Oxides%20are%20a%20family,equipment%2C%20boats%2C%20etc.)">[5]</a> PT08.S3 (tungsten oxide) hourly averaged sensor response (nominally NOx targeted), True hourly averaged NO2 concentration in microg/m³ (reference analyzer); NO2 (Nitrogen Dioxide) falls under the group of NOx or Nitrogen Oxides but is greater cause for concern due to its aggressive impact on health and the environment. PT08.S4 (tungsten oxide) hourly averaged sensor response (nominally NO2 targeted), PT08.S5 (indium oxide) hourly averaged sensor response (nominally O3 targeted), Temperature in °C, relative humidity (%), and absolute humidity.</p><p>With that additional attribute context in mind, it’ll be easier to perform data visualization and extract key insights.</p><p>You can find the Kaggle Notebook complete with data visualizations <a href="https://www.kaggle.com/tenzinmigmar/extracting-air-quality-insights-w-visualization/edit/run/59429696">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72751b1f64d0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Amazon Rainforest with  Multi-Label Classification + VGG-19, Inceptionv3…]]></title>
            <link>https://medium.com/data-science/understanding-the-amazon-rainforest-with-multi-label-classification-vgg-19-inceptionv3-5084544fb655?source=rss-37529e2ae723------2</link>
            <guid isPermaLink="false">https://medium.com/p/5084544fb655</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[nature]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Tenzin Migmar]]></dc:creator>
            <pubDate>Sat, 13 Mar 2021 00:18:46 GMT</pubDate>
            <atom:updated>2021-03-14T03:32:33.714Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zv2BUNydlMV0-hwCNc2Jg.png" /><figcaption>Photo by <a href="https://unsplash.com/@fabiofistarol">Fabio Fistarol</a> on <a href="https://unsplash.com/photos/adLo80F_9P0">Unsplash</a>.</figcaption></figure><h3>Understanding the Amazon Rainforest with Multi-Label Classification + VGG-19, Inceptionv3, AlexNet &amp; Transfer Learning</h3><h4>The Power of Artificial Intelligence for Ecosystem Preservation</h4><h4>Table of Contents</h4><p>i. Introduction</p><ul><li>State of the Amazon Ecosystem</li><li>The potential of Artificial Intelligence</li></ul><p>ii. Understanding the Dataset</p><p>iii. Computer vision; Conv-net architectures</p><ul><li>Multi-label Classification</li><li>VGG-19</li><li>AlexNet</li><li>Inceptionv3</li><li>Transfer Learning</li></ul><p>iv. Amazon Satellite Chip Imagery ML Classification Model</p><ul><li>Data Visualization / Exploratory Analysis</li><li>Preprocessing</li><li>Model</li><li>Comparison of Model Performance</li></ul><p>v. Closing Notes</p><p>The Amazon Rainforest: lush with greenery and biodiversity houses an abundance of the flora and fauna found here on Earth. Dense and teeming with life, the functions of the Amazon isn’t just limited to being a fascinating biome. The Amazon acts as a critical carbon sink; sequestering an excess of <a href="https://apnews.com/article/384fdb5ee7654667b53ddb49efce8023">two billion tons or 5%</a> of annual emissions of carbon out of the air.</p><p>The Amazon also provides a repository of natural resources ranging from transportation and freshwater through the Amazon river, valuable minerals, global food supply, medicinal plants with special properties that can be used to treat diseases. To quantify the impact of the Amazonian flora on medicine: <a href="https://www.telegraph.co.uk/travel/cruises/articles/how-to-be-a-botanical-buff/">25% </a>of all drugs used today are sourced from the Amazon, <a href="https://amazonaid.org/global-importance-amazon-natural-resources/">41 various species of plants</a> in the Brazilian Amazon can work as treatments for Malaria,<a href="https://amazonaid.org/global-importance-amazon-natural-resources/"> 70% of plants</a> that have been found to have anti-cancer properties have been found in the Amazon rainforest. Nature’s pharmacy lies within the Amazon rainforest.</p><p>The Amazon is by design, ill-fated to human greed.</p><p>In a state of siege from farming, ranching, urban development, logging, and mining, the utility of the Amazon is being drained. All of the rainforest’s resources, beauty, and wonderment are being wrung out of the 5.5 million km² of exuberant life and all of the constituents who depend on the Amazon are being hung out to dry. Even more so disquieting, the destruction of the Amazon is spoon-feeding tonnes of more carbon into the looming jaws of climate change and aggravating a positive feedback loop: deforestation increases the temperatures of the Amazon, drying out the vegetation and subsequently nurturing and promoting more forest fires.</p><p>In order to mitigate further damage to the Amazon, it will be critical to:</p><ul><li>Heighten regulations and improve or draft policies that align with the best interests of the ecosystem.</li><li>Automate monitoring around human activity and operations. (Where artificial intelligence comes into the equation.)</li><li>Understanding the root causes and issues. With all solutions, it begins with understanding the problem. Unshrouding the secrecy behind the Amazon rainforest’s land use operations is a good place to mark the starting line in solving the holistic issue of rainforest destruction.</li></ul><p>Harnessing the power of artificial intelligence, we can better understand through satellite imagery and computer vision applications the human activities occurring within the Amazon and increase regulation accordingly.</p><h4>Understanding the Dataset</h4><p>The dataset is provided by P<a href="https://www.planet.com/company/careers/">lanet</a> and imposes a multi-label classification problem in which satellite image chips must be labeled according to their atmospheric conditions and land-use.</p><p>The dataset includes a train_csv file which is where the labels are located and the image chips are found under train/test-jpg.</p><p>The image chips were sourced from 4-band satellites in sun-synchronous orbit and International Space Station orbit.</p><p>The labels are not mutually exclusive and can be classified as: artisinal mine, conventional mine, partly-cloudy, habitation, bare ground, blooming, selective logging, road, cultivation, water, agriculture, haze, primary, blowdown, cloudy, clear, and/or slash-burn.</p><p>The dataset can be found here:</p><p><a href="https://www.kaggle.com/c/planet-understanding-the-amazon-from-space/overview">Planet: Understanding the Amazon from Space</a></p><h4>Computer Vision; Conv-Net Architectures</h4><p>Computer vision is a subset of machine learning falling under the broad domain of artificial intelligence that allows computers to see and learn a high-level understanding of images.</p><blockquote><em>“At an abstract level, the goal of computer vision problems is to use the observed image data to infer something about the world.”</em></blockquote><blockquote>— <a href="https://amzn.to/2rxrdOF">Computer Vision: Models, Learning, and Inference</a>, 2012.</blockquote><p>The processes of computer vision mimic the human visual system; the field aims to teach computers the intricacies of taking in visual input data, processing it, and outputting results. As humans, we do this on the fly without giving it much thought or effort but it becomes a much more complex task when trying to gift this ability to machines.</p><p>In recent years, the field has been transformed by Convolutional Neural Networks: a class of neural networks that are specifically designed for visual imagery applications.</p><p>Convolutional Neural Networks are made up of two main components:</p><ol><li><strong>Feature Extraction</strong></li></ol><p>This is the segment of the network where the model applies a series of operations to the image data with the main goal of deriving features* from images.</p><p>The layers of the convolutional neural network that collaborate to perform these operations and extract the features are:</p><ul><li>Convolution → The first layer in feature extraction. The convolution layer applies filters to the input image in order to learn the image features.</li><li>Pooling → Output of the feature maps from the convolution layer will then be downsampled. Hence, the primary function of the pooling layer is for spatial dimensionality reduction. Here, the pooling operation is applied so that only the most salient features are highlighted in the feature maps.</li><li>Flattening → Layer before the fully-connected layer that flattens the pooled feature map input into a one-dimensional array; this output will then be passed to the fully-connected layer.</li></ul><p>* Patterns, lines, characteristics of an object that allow us to identify it.</p><p>2. <strong>Classification</strong></p><p>This portion of the Convolutional Neural Network is responsible for the classification of the images into one or more of the predetermined classes. This varies depending on the task: regular image multi-classification would mean classifying the entire image into one of the classes, semantic segmentation works on a more granular level, classifying all of the pixels within the image into a class, again, this depends on the data.</p><p>Layers of the Convolutional Neural Network that are used here:</p><ul><li>Fully connected layer → The final layer in a convolutional neural network. The fully connected layer generates the final prediction of an input image based on the probabilities of each of the classes.</li></ul><p>As previously mentioned, the dataset is a multi-label classification problem. Unlike multi-classification where images are grouped under <em>one</em> of the multiple classes, in multi-label classification, some of the images may only fall under one of the target values whereas others may account for two, three, four, or even all seventeen.</p><p>Full disclosure: prior to this, I’ve never worked with satellite image data. Curious about which convolutional neural network architectures work best on satellite imagery, I decided to experiment with some common convolutional neural network architectures and compare the performances of each model.</p><p>Convolutional neural network architectures used:</p><ol><li><strong>VGG-19</strong></li></ol><p>VGG-19 is a convolutional neural network architecture developed by the Visual Geometry Group; it became more well-versed in the computer vision community after being named the runner-up of the 2014 ILSVRC classification task. It is often associated with VGG-16 with the difference being that VGG-19 has 19 layers with trainable weights rather than 16, hence the name.</p><p>The highlight of the VGG-19 architecture:</p><blockquote>“using an architecture with very small ( 3 × 3) convolution filters, which shows that a significant improvement on the prior-art configurations can be achieved by pushing the depth to 16–19 weight layers.” — Very Deep Convolutional Networks For Large-Scale Image Recognition</blockquote><p>The original authors go more in-depth on the configurations of the architecture in their original research paper <a href="https://arxiv.org/pdf/1409.1556.pdf">here</a>.</p><p>2. <strong>AlexNet</strong></p><p>AlexNet; authored by Alex Krizhevsky, Ilya Sutskever, Geoffrey E. Hinton is best known for winning the ILSVRC 2012 competition by an immense error margin and can be credited with stimulating the rise in popularity of convolutional neural networks.</p><p>Characteristics of the architecture include:</p><ul><li>Architecture layers include 5 convolutional layers and 3 max-pooling layers.</li><li>The activation function used is Relu instead of Tanh which introduced non-linearity and improves training speed.</li><li>Overlapping max pooling is used in reducing the error rate.</li><li>The architecture also makes use of drop-out layers after the fully-connected layers to avoid the issue of over-fitting.</li></ul><p>3. <strong>Inceptionv3</strong></p><p>Inceptionv3, as the name suggests, is the third variation of the Inception convolutional neural network. Inceptionv3 builds upon the foundations of its predecessors Inception and Inceptionv2.</p><p>Here’s a timeline of the Inception models and their papers:</p><p>Inception → The design of Inception highlights the increase in the network’s width and depth without compromising on computational resources.</p><p>Read the paper <a href="https://arxiv.org/pdf/1409.4842v1.pdf">here</a>.</p><p>Inceptionv2 → The second variation of Inception introduced in Rethinking the Inception Architecture for Computer Vision.</p><blockquote>“we are exploring ways to scale up networks in ways that aim at utilizing the added computation as efficiently as possible by suitably factorized convolutions and aggressive regularization.” — Rethinking the Inception Architecture for Computer Vision</blockquote><p>Read the paper <a href="https://arxiv.org/pdf/1512.00567v3.pdf">here</a>.</p><p>Inceptionv3 layers:</p><ul><li>Convolution</li><li>Average Pool</li><li>Max Pool</li><li>Dropout</li><li>Fully-connected</li></ul><p>Same paper as Inceptionv2.</p><p><strong>The Concept of Transfer Learning</strong></p><p><a href="https://towardsdatascience.com/a-comprehensive-hands-on-guide-to-transfer-learning-with-real-world-applications-in-deep-learning-212bf3b2f27a">Transfer Learning</a> is a method used in machine learning where knowledge (learnable parameters like weights and biases) from one model that was pre-trained can be leveraged in another model with the benefits being:</p><ol><li>Faster training time</li><li>Improved performances in applications where data is limited.</li><li>Better generalization; prevents overfitting.</li></ol><p>Simply put, it’s the use of a model that was already trained on a specific dataset and can now be applied to another problem.</p><p>Generally, <a href="https://towardsdatascience.com/a-comprehensive-hands-on-guide-to-transfer-learning-with-real-world-applications-in-deep-learning-212bf3b2f27a">transfer learning</a> is best put to use when the data you have is limited and in scarce quantity or the problem lies in the domain of the data that the model was previously trained on.</p><p>Keras offers deep learning image classification models with weights that were pre-trained available for transfer learning usage. Popular convolutional neural network architectures such as Xception, VGG16, VGG19, ResNet50, Inceptionv3, DenseNet121, EfficientNetB7, and others are available to be used.</p><h4>Amazon Rainforest Satellite Imagery Multilabel Model</h4><p><strong>Data visualization</strong> is always a good place to start. If performed correctly, exploratory data analysis can extract key insights that can then be used to design a model that aligns with the data. For example: is the data limited? Then maybe transfer learning might be a good idea. Missing a lot of values? Feature engineering could possibly help. This stage of the process is to glean a better understanding of the crux of machine learning: data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/55d29af4771be843235313704ab0903b/href">https://medium.com/media/55d29af4771be843235313704ab0903b/href</a></iframe><pre><strong>     image_name              tags</strong></pre><pre>0    train_0                 haze primary<br>1    train_1                 agriculture clear primary water<br>2    train_2                 clear primary<br>3    train_3                 clear primary<br>4    train_4               agriculture clear habitation primary road<br>5    train_5                 haze primary water<br>6    train_6             agriculture clear cultivation primary water<br>7    train_7                 haze primary<br>8    train_8                 agriculture clear cultivation primary<br>9    train_9              agriculture clear cultivation primary road</pre><pre>(40479, 2)</pre><pre>{&#39;habitation&#39;, &#39;clear&#39;, &#39;cultivation&#39;, &#39;slash_burn&#39;, &#39;bare_ground&#39;, &#39;artisinal_mine&#39;, &#39;road&#39;, &#39;primary&#39;, &#39;selective_logging&#39;, &#39;conventional_mine&#39;, &#39;partly_cloudy&#39;, &#39;agriculture&#39;, &#39;water&#39;, <br>&#39;cloudy&#39;, &#39;blow_down&#39;, &#39;haze&#39;, &#39;blooming&#39;}</pre><p>There are 40479 values in the training csv file and the 17 labels are printed.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3b917857bc4aa8ff1edfe0efaff4f5f4/href">https://medium.com/media/3b917857bc4aa8ff1edfe0efaff4f5f4/href</a></iframe><pre># values with one label<br>cloudy<br>cloudy<br>cloudy<br>cloudy<br>cloudy<br>cloudy<br>cloudy<br>[...]</pre><pre># values with six labels<br>agriculture clear habitation primary road water<br>blooming clear cultivation habitation primary slash_burn<br>agriculture clear habitation primary road water<br>agriculture bare_ground clear habitation primary road<br>agriculture clear cultivation habitation primary road<br>agriculture clear cultivation habitation primary road<br>[...]</pre><pre># values with nine labels<br>agriculture clear cultivation cultivation habitation primary road slash_burn water<br>agriculture artisinal_mine clear conventional_mine cultivation habitation primary road water<br>[...]</pre><p>Note: this dataset does not contain any images with more than nine labels.</p><p>Now with the number of values per number of labels, we can plot the distribution to check for class imbalance.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/49e6ba340f440137869402e0ea375961/href">https://medium.com/media/49e6ba340f440137869402e0ea375961/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*-1q239ZaJiCGuvfN43Px4Q.png" /></figure><p>Based on the distribution plot, most of the images have 2, 3, or 4 labels.</p><p>It’s also a good idea to visualize the images to get a sense of what the model centers predictions around.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/aae35b0406d4d81709668721a3b74ce3/href">https://medium.com/media/aae35b0406d4d81709668721a3b74ce3/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0RQGpJwiMhdyeG7ch_YyIw.png" /></figure><p><strong>Data preprocessing</strong></p><p>To preprocess the data, start by reading in the images. The dataset provides 40479 values but for the sake of speeding up training; I read in 20,000 values and split 16,000–4000 on training and validation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8f6908375c0108967e97ca45f826e00b/href">https://medium.com/media/8f6908375c0108967e97ca45f826e00b/href</a></iframe><p>The images are loaded into normalized NumPy arrays. Now to load in the target values or the y values. Again, this is a multi-label classification problem so there will be more than one label for some images. As previously mentioned, I split the data 16,000–4,000 for training-validation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/229591ffca5c93b3723a2effabd647f0/href">https://medium.com/media/229591ffca5c93b3723a2effabd647f0/href</a></iframe><pre>array([[0, 0, 0, ..., 0, 0, 0],<br>       [1, 0, 0, ..., 0, 1, 0],<br>       [0, 0, 0, ..., 0, 1, 0],<br>       ...,<br>       [1, 0, 0, ..., 0, 1, 0],<br>       [0, 0, 0, ..., 0, 1, 0],<br>       [0, 0, 0, ..., 0, 1, 0]])</pre><h4>Models</h4><p><strong>VGG-19 — Using the Sequential API</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d4a94757a07f64d7937647e12cec4a42/href">https://medium.com/media/d4a94757a07f64d7937647e12cec4a42/href</a></iframe><p><strong>AlexNet — Using the Sequential API</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93e4a058ffa0296cb4df8aa5542ea6a9/href">https://medium.com/media/93e4a058ffa0296cb4df8aa5542ea6a9/href</a></iframe><p><strong>Inceptionv3 + Transfer Learning — Functional API</strong></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69288aa4ae9950e08f83318409a4b082/href">https://medium.com/media/69288aa4ae9950e08f83318409a4b082/href</a></iframe><h4>Comparison of Model Performance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*Lq6873iwuiHJCZAPfEjysA.png" /><figcaption>Image by author.</figcaption></figure><p>It’s important to note here that I resized and trained the model on the image dimensions of VGG-19 to 32 by 32 rather than 128 by 128. The epoch ETA was approximately 4 hours each for VGG-19 and I wanted to speed up the training process.</p><p>Notably, the training accuracies are all within close margins but there is a disparity in the validation accuracies.</p><p>Taking a look at the chart, it’s difficult to crown a winner; however, there is potential for Inceptionv3 + Transfer Learning model to further improve validation accuracy. Nominally, I’ll declare Inceptionv3 + Transfer Learning to have performed the best out of the three using a holistic perspective (training acc, validation acc, and training speed).</p><h4>Closing Notes</h4><p>Okay, I’ll admit, I finish off every one of these machine learning projects off with “this dataset was interesting to work with” but this one especially unlocked a deeper level of appreciation for artificial intelligence.</p><p>I started this project off curious to learn more about land-use but ended up also learning about all the different functions of the rainforest along the way too. That’s the wonderful thing about working with unfamiliar data, you end up adding some to your own personal knowledge.</p><p>Real-world applications of artificial intelligence are always the most exciting and awe-inspiring. To improve the quality of life here on Earth should be at the forefront of why we build, invent, and create; otherwise, these tasks quickly become meaningless. I’ll be on the look-out for more real-world impact data sets in the future; and if you have any, link them in the comments! I’d love to explore them.</p><p>Check out some of my other work &amp; connect with me on <a href="https://www.linkedin.com/in/tenzin-migmar-a076781b3/">LinkedIn</a>:</p><p><a href="https://www.kaggle.com/tenzinmigmar/lunar-rocky-landscape-segmentation-with-u-net">Lunar Rocky Landscape Segmentation with U</a>-Net</p><p><a href="https://www.kaggle.com/tenzinmigmar/galaxy-multi-image-classification-with-lenet-5">Galaxy Multi-Class Image Classification with LeNet-5</a></p><p><a href="https://www.kaggle.com/tenzinmigmar/classifying-iris-flower-types-with-k-means">Classifying Iris-Flower Types with K-Means</a></p><p>* References have been hyperlinked!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5084544fb655" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/understanding-the-amazon-rainforest-with-multi-label-classification-vgg-19-inceptionv3-5084544fb655">Understanding the Amazon Rainforest with  Multi-Label Classification + VGG-19, Inceptionv3…</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Algorithms in Machine Learning]]></title>
            <link>https://tenzin-migmarr.medium.com/algorithms-in-machine-learning-aec39d812f1a?source=rss-37529e2ae723------2</link>
            <guid isPermaLink="false">https://medium.com/p/aec39d812f1a</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[future]]></category>
            <dc:creator><![CDATA[Tenzin Migmar]]></dc:creator>
            <pubDate>Thu, 01 Oct 2020 20:49:13 GMT</pubDate>
            <atom:updated>2021-03-30T03:47:14.376Z</atom:updated>
            <content:encoded><![CDATA[<p>A wide scope — but not exhaustive— guide to algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*_TOputdD5T-Z15fF" /><figcaption>Where machine meets intelligence; the creation of AI.</figcaption></figure><p>Algorithms are the agents that propel machine learning forward, and they’re the source of life that powers artificial intelligence — a technology that will transform virtually every aspect our our lives. In this guide, you will be exposed to these algorithms and gain a rudimentary understanding of how these models work.</p><h4>Linear Regression</h4><p>Linear regression is a supervised learning algorithm used to estimate the predictions of values between two continuous variables. The algorithm searches for and defines a linear relationship between the independent (the value we’re trying to predict) and the dependent variables (values used to predict) by fitting a line of best fit through the data. The line of best fit can be modeled as a single linear equation: y = θ0 + θ1 * x. To improve the results and accuracy of our algorithms predictions, we must minimize the error between the data points and line of best fit to the highest degree possible. Through training, our model learns to continuously update and minimize θ0 and θ1, but to do this, we’ll introduce the cost function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*k4NlzxYw05Vq7VDYgvY5pw.png" /><figcaption>Linear Regression Model.</figcaption></figure><p>Cost function (J) is used as the root mean squared error or RMSE of the predicted y values (our model predicts the price of a 3-floor house in Toronto is 987,000) and the actual/true y values (the price of a 3-floor house in Toronto costs 1,200,000). We want to minimize the RMSE to the lowest extent that exists, and in doing so, we’ll refer to Gradient Descent.</p><p>The concept of Gradient Descent is to start at arbitrary values for θ0 and θ1 and then to iterate through updating the values to minimize error with each iteration until arriving at the minimum cost.</p><h4>Logistic Regression</h4><p>A form of a classification algorithm, Logistic Regression predicts in a binary fashion. The output is designated to be assigned to one of two classes. For example, malignant or benign tumors, whether a student failed or passed history class, etc. The logistic function is also known as the sigmoid function: 1 / (1 + e^-value)</p><p>Logistic Regression operates similar to its cousin Linear Regression, but a threshold (0.5) is set to filter the continuous values between 0 and 1 into two classifications. For example: suppose we wanted to classify breast cancer tumors as malignant or benign based on features like radius, texture, concavity, etc. If the total value output was greater than 0.5, then the tumor would be classified as malignant, and if not, then the tumor would be classified as benign.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*0SXWy9u3VC1__yhgUrfGNA.png" /><figcaption>Logistic Regression Model.</figcaption></figure><h4>Decision Trees</h4><p>Decision trees heavily rely on a flow chart model and preset conditions combined with data to determine the prediction for a given value. Decision trees are composed of individual nodes. Nodes have hierarchical classes: root nodes are the first feature we encounter to split the data upon, internal nodes are features that can be further split on, the ending nodes where predictions of 0 or one (final prediction for one of two classes) is made are referred to as the leaf nodes, and the nodes as a result of internal nodes being split on are called the node’s children.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*MU46qZ21zlCYKMpYXD7Wkw.png" /><figcaption>Decision Tree Model.</figcaption></figure><p>When constructing the decision trees, the order of influence matters. For example, if we were working with the Titanic dataset, we would look to select a root node that has the highest degree of predictive power, in which case, we would elect the sex of the passenger as the root node because woman were in higher favor of survival with lifeboats historically. From then, we would consider the remaining features and select their positions in the decision tree in accordance with the predictive power.</p><p>The premise of decision trees is to rely on control flow to arrive at a prediction.</p><h4>Random Forest</h4><p>Random forest is a supervised learning algorithm for classification and regression problems that utilizes the methodology of decision trees, but true to the name of the algorithm, relies on a forest of decision trees. When training, Random Forest generates the decision trees and when predicting new data points, if the problem at hand involves classification, Random Forest will output the mode of the classes. If the solution entails regression, then the algorithm will give the mean prediction of the individual trees.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*hmrv8DfwPDVk8mK_g23hfA.png" /><figcaption>Random Forest Model</figcaption></figure><p>The concept behind Random Forest is that because Decision Trees individually are prone to overfitting due to the nature of the model, the Random Forest is designed to reduce overfitting (when our model is overly fit to our training data, it performs poorly on the testing data due to the incorrect assumption that real-world data will bare an identical resemblance to the training data) Random Forests generally perform well on most datasets and have high interpretability making them easy to understand and explain, however, they are quite computationally heavy.</p><h4>Support Vector Machines</h4><p>Support Vector Machines (SVMS) are a supervised learning algorithm for classification and regression problems, but more commonly so for classification. The model works with hyperplanes in n-dimensional space — n correlates to the number of features your data has — and plots individual data points. The value of each feature is treated as one of the coordinates (also known as support vectors, hence the name of the algorithm) of the data point. For instance, suppose our data has two features: weight and height. These two features will be plotted in two-dimensional space, and each value for the features will be a coordinate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*linUvVgL9rJEjNqLyTYing.png" /><figcaption>Support Vector Machine Model.</figcaption></figure><p>Now, we’ll fit a line that splits the two classifications of groups in our data, and the line must be positioned as such that it leaves the largest margin of space possible between the two closest points with each of the one points representing one of the two classifications. If the data cannot be split to produce accurate predictions, then we’ll have to introduce more dimensions.</p><h4>K-Nearest Neighbors</h4><p>K-Nearest Neighbors, also known as KNN, is a supervised learning algorithm that is designed to take in as an assumption that data values in closer proximity are within the same classification. The whole model heavily relies on the concept that distance can be used to make accurate predictions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*U6sG4-Du-xY6wUpMdACuIg.png" /><figcaption>K-Nearest Neighbors Model.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*jjHqwz2eBmV0eUW3SKOR_g.png" /></figure><p>The K in K-Nearest Neighbors refers to the number of neighbors distances we’ll calculate to make a prediction. Let’s suppose we had an Iris dataset in which we’ll classify various species of Irises (Setosa, Virginica, &amp; Versicolor) and our features for classification were petal width, petal length, sepal width, &amp; sepal length.</p><p>The training data points for this dataset would be plotted to their respective values. From there, upon prediction, suppose we had a testing data point, an object with an unknown classification. If we set k = 3, the amount of nearest neighbors to the unknown object our algorithm would search for would be 3, and the object would be assigned to the most common class.</p><p>It’s best practice to set k to an uneven number which would eradicate running the risk of a tie.</p><h4>Artificial Neural Networks</h4><p>Artificial neural networks are a type of machine learning that is loosely modeled off the human brain. To create a neural network we must have at least 3 layers of neurons: an input layer, hidden layer, and output layer.</p><p>The input layer is made up of the features of our data, for example: if we wanted our neural network trained to classify handwritten digits, each pixel could be a feature. While the output layer is composed of the predictions. On the same note of the last example, each output neuron may represent a digit outcome. The hidden layer(s) usually make up the bulk of our neural network, and the layers in between the hidden layers have neurons that have connections between them. For a neural network used to classify images, each layer may serve to recognize a certain portion of the image. The first hidden layer may focus on small corners in the digits, the next may grapple with the smaller lines in the digits, and so and so forth. With each layer, the complexity of the portion of the image gradually increases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*cElVKFc7Te8kY7mNe94g0w.png" /><figcaption>Neural Networks Model.</figcaption></figure><p>Depending on the complexity of our model, we may have many hidden layers and that would result in a deep neural network. Deep learning is a subset of machine learning. As we’re training the neural network, what’s happening is that the network is refining and tuning the parameters of the connections between the neurons until it is able to make accurate predictions.</p><h4>Citations and Further Resources for Readers</h4><ul><li><a href="https://www.thebalancesmb.com/what-is-simple-linear-regression-2296697">How Simple Linear Regression, Used to Analyze Quantitative Data</a></li><li><a href="https://careerfoundry.com/en/blog/data-analytics/what-is-logistic-regression/">What is Logistic Regression?</a></li><li><a href="https://en.wikipedia.org/wiki/Logistic_regression">Logistic regression - Wikipedia</a></li><li><a href="https://www.geeksforgeeks.org/decision-tree/#:~:text=%20Decision%20Tree%20%201%20Construction%20of%20Decision,able%20to%20generate%20understandable%20rules.%20Decision...%20More%20">Decision Tree - GeeksforGeeks</a></li><li><a href="https://www.techopedia.com/definition/32935/random-forest#:~:text=Random%20Forest.%20Definition%20-%20What%20does%20Random%20Forest,enhance%20the%20ways%20that%20technologies%20analyze%20complex%20data.">What is a Random Forest? - Definition from Techopedia</a></li><li><a href="https://builtin.com/data-science/random-forest-algorithm">Random Forest: A Complete Guide for Machine Learning</a></li><li><a href="https://towardsdatascience.com/support-vector-machine-introduction-to-machine-learning-algorithms-934a444fca47">Support Vector Machine — Introduction to Machine Learning Algorithms</a></li><li><a href="https://en.wikipedia.org/wiki/Support_vector_machine"></a></li><li><a href="https://towardsdatascience.com/machine-learning-basics-with-the-k-nearest-neighbors-algorithm-6a6e71d01761">Machine Learning Basics with the K-Nearest Neighbors Algorithm</a></li><li><a href="https://www.explainthatstuff.com/introduction-to-neural-networks.html#:~:text=Information%20flows%20through%20a%20neural%20network%20in%20two,these%20in%20turn%20arrive%20at%20the%20output%20units.">How neural networks work - A simple introduction</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=aec39d812f1a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Nature’s design or humans? Biomimicry says both]]></title>
            <link>https://uxdesign.cc/natures-design-or-humans-biomimicry-says-both-526d3c2e4c38?source=rss-37529e2ae723------2</link>
            <guid isPermaLink="false">https://medium.com/p/526d3c2e4c38</guid>
            <category><![CDATA[ux]]></category>
            <category><![CDATA[sustainability]]></category>
            <category><![CDATA[design]]></category>
            <category><![CDATA[biomimicry]]></category>
            <category><![CDATA[nature]]></category>
            <dc:creator><![CDATA[Tenzin Migmar]]></dc:creator>
            <pubDate>Mon, 28 Sep 2020 21:44:45 GMT</pubDate>
            <atom:updated>2020-10-05T19:10:59.786Z</atom:updated>
            <content:encoded><![CDATA[<h4>Nature should be the blueprint for human design more often than not.</h4><figure><img alt="A humpback whale ascending to the surface." src="https://cdn-images-1.medium.com/max/938/0*kQnTjIe1sWKRLRg-" /><figcaption>Photo courtesy of Monterey Bay Aquarium.</figcaption></figure><p>What if we copied nature in the process of design? Maybe our world would be more efficient, cutting-edge, and cleaner if the origin of our concepts for design were derived from the most ancient designer: nature. But we don’t. Our world is poorly designed because we fail to draw inspiration from the architecture of the natural world. The wildlife that we interact with while simultaneously in awe of nature’s magnum opus is constrained to just that environment, not the bustling cities we inhabit down to the transportation we take and the problems we create. Imitation is the highest form of flattery; so what if we started stealing the blueprints for our world from nature?</p><p>Biomimicry is the emulation of nature’s models, systems, processes, and elements; we imitate nature to improve human designs and create tangible solutions to even the world’s most pressing problems. We seek its advice and look towards nature’s creations to guide us through the design process rather than relying solely on our own expertise. Let’s look at some of the applications of Biomimicry.</p><p>Japan’s bullet trains are fast. Really fast. However, they were also notorious for the noise created when exiting the tunnels as a result of the displaced air that residents associated with a sonic boom. This noise disruption was an issue because it disquieted high-density neighborhoods which were known to conglomerate around the bullet trains.</p><p>The involvement of sourcing nature’s genius into fixing this issue came through observance as the general manager on the technical development of the bullet train — Eiji Nakatsu — was a bird watcher. The Kingfisher, a bird with a beak that allows it to gracefully dive into water with little to no splash was the inspiration for the nose of the train. Other redesigned features of the train were also modeled with the use of Biomimicry such as the pantograph. The pantograph’s ( a framework rig that connects the train to overhead wires ) design was derived from the feathers of owls to aid in reducing noise. The end result of borrowing concepts from nature? Train speeds increased by 10%, consumed 15% less energy, and the issue with the noise was resolved.</p><figure><img alt="A combination of the animals with features mimicked for the train. Left to right: Owl, Kingfisher, Adele Penguin." src="https://cdn-images-1.medium.com/max/1024/0*rehxd3Ch6NWUf0WL.jpg" /><figcaption>Image courtesy of Vox.</figcaption></figure><p>What we can do with the technology of biology isn’t limited to just the structures of nature’s creations, we can also learn from and apply the patterns and textures present in lifeforms like sharks. The surface of shark skin is coated with a layer of microscales (dermal denticles) and has a texture that could be described as ridged and grooved. A material called Sharklet which mimics the texture of shark skin was tested by scientists and compared against smooth surfaces and performed notably. The Sharklet was discovered to have contained an overwhelming 94% less MRSA bacteria.</p><p>If implemented in environments that inadvertently promote the proliferation of nasty germs and bacteria, such as the hospital because of the congregation of the sick and public use facilities, we could see a decrease in the spread of bacteria-related illnesses.</p><p>In contrast to standard antimicrobial surfaces, however, Sharklet doesn’t kill bacteria but merely increases the difficulty for bacteria to latch on. This resistance approach to bacteria as opposed to the eradication of it has led to promising results, but of course, the effectiveness of Sharklet will also heavily rely on the material used in combination with the sharkskin texture.</p><figure><img alt="The texture of sharkskin." src="https://cdn-images-1.medium.com/max/500/0*H2_zIoCLIpkkqZRA.png" /><figcaption>Image courtesy of The Curiosity Chronicles.</figcaption></figure><p>The ocean is as illuminating to the innovation of products, processes, and strategies as it is deep. The world down underwater can provide key insights to aid us in tackling one of the biggest problems humanity will face, energy. The solution is sustainable and it also involves the pectoral fins of humpback whales.</p><p>Humpback whales are agile in aerodynamics. That can be accredited to their pectoral fins which allow for the propulsion back into the water at steep attack angles to catch fish. (Humpback whales diets aren’t constrained to just krill and their hunting habits aren’t limited to only remaining underwater) Supposing that whales had smooth pectoral fins in the stead of the bumpy ridged fins, the attack angle’s steepness would be decreased up to a considerable 40%.</p><p>These pectoral fins provide us with a blueprint of what an optimal design for wind turbines look like to minimize drag and increase lift. The US Naval Academy considered this and ran tests comparing the performance of current industry-standard wind turbines and wind turbines designed to mimic whale fins, and found that the implementation of Biomimicry in wind energy allowed for the reduction of drag by one third, and an 8% enhancement in lift. Start-ups like Whale Power are racing to get this technology out to the market having gleaned nature’s advice and implemented it into refined wind turbine blades and the fruition of their efforts is encouraging. Massachusetts Institute of Technology has confirmed that the Biomimicry blades produce equivalent power at 10 miles per hour than standard turbines turn out at 17 miles per hour. Close to double the efficiency.</p><figure><img alt="Biomimicry design applied to wind turbine blade. The edges of the turbine are changed to mimic the ridges of pectoral fins." src="https://cdn-images-1.medium.com/max/762/0*b6817BRpRvcWc7Ra.jpg" /><figcaption>Photo courtesy of Biomimicry Institute.</figcaption></figure><p>What if we consulted nature’s expertise more often? If the designs that have stood the test of time over eons of evolution were positioned at the forefront of engineering, the building blocks of civilization like cities and the processes that are central to the operation of our daily lives would be more efficient. We might have eloquent solutions to issues in the world, but in order to source our products, designs, and ideas from nature’s ingenuity it will demand humility from humans; our creations come second to none other than what has created us. The conception of every elegant design, solution, or process doesn’t necessarily have to originate from humans; there is also unparalleled beauty and wonderment in the modern innovation of ancient design.</p><h4>Citations</h4><p><a href="https://biomimicry.net/b38files/A_Biomimicry_Primer_Janine_Benyus.pdf">https://biomimicry.net/b38files/A_Biomimicry_Primer_Janine_Benyus.pdf</a></p><p><a href="https://www.digitaltrends.com/cool-tech/biomimicry-examples/">https://www.digitaltrends.com/cool-tech/biomimicry-examples/</a></p><p><a href="https://www.meddeviceonline.com/doc/shark-skin-inspires-antimicrobial-surfaces-">https://www.meddeviceonline.com/doc/shark-skin-inspires-antimicrobial-surfaces-</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/94/0*ZuP-S4MiLarjemzb" /><figcaption>The UX Collective donates US$1 for each article published in our platform. This story contributed to <a href="https://www.bayareablackdesigners.com/">Bay Area Black Designers</a>: a professional development community for Black people who are digital designers and researchers in the San Francisco Bay Area. By joining together in community, members share inspiration, connection, peer mentorship, professional development, resources, feedback, support, and resilience. Silence against systemic racism is not an option. Build the design community you believe in.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=526d3c2e4c38" width="1" height="1" alt=""><hr><p><a href="https://uxdesign.cc/natures-design-or-humans-biomimicry-says-both-526d3c2e4c38">Nature’s design or humans? Biomimicry says both</a> was originally published in <a href="https://uxdesign.cc/">UX Collective</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[(Art)ificial Intelligence]]></title>
            <link>https://tenzin-migmarr.medium.com/art-ificial-intelligence-cbc8c6e951a7?source=rss-37529e2ae723------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbc8c6e951a7</guid>
            <category><![CDATA[philosophy]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[art]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai-art]]></category>
            <dc:creator><![CDATA[Tenzin Migmar]]></dc:creator>
            <pubDate>Thu, 24 Sep 2020 19:19:13 GMT</pubDate>
            <atom:updated>2020-09-24T19:59:16.916Z</atom:updated>
            <content:encoded><![CDATA[<h4>When machines collide with the world of art.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CKJ_e-9nDW9FS-yF.jpg" /><figcaption>Robot <em>CloudPainter at work on a painting. Image courtesy of CloudPainter.</em></figcaption></figure><p>If ancient philosophers caught wind of the artificial intelligence humans would go later create, they’d no doubt wax poetic about the selcouth beauty in the idea of those creations sharing in what we believed to be an ability limited to only humans: art. Art is the fabric of human expression. The earliest humans used paintings and drawings as a medium of facilitating communication; but with humans once again pushing the limitations and boundaries of technology, discoveries become unearthed and advancements are made. This of course imposes critical discourse (however inadvertently) on us to demarcate the attributes of what makes us human and what makes something robot. This deceptively straightforward task is more demanding of considerable thinking and analysis than it lets on. The more we unearth, discover, and charter new territory in this unknown, the murkier the answers we believed to be clear become.</p><p>Art’s nature is inherently subjective. Where someone may see a flower, another might see the beginnings of a curved elephant trunk or a piece may be met with glowing enthusiasm by a legion of art zealots but simultaneously face sharp criticism from another connoisseur. Philosophers have long debated how to succinctly condense art into a definition but were largely met with unsuccess. The difficulty in summarizing what constitutes and what doesn’t as art however creates a capacity of negotiation for AI art — there’s no certain criteria for something undefined. However for the most part, there is a social consensus that exists that art should fall within the realm of being i) aesthetically pleasing ii) emotionally expressive.</p><p>Any artist will tell you that art is a process. Years and years of deliberate practice compounded result in artistic ability; the skill does not reveal itself within a night’s work. Artificial intelligence also has the potential and capacity to learn how to create art and they’re able to through Generative Adversarial Networks (or GANs for short). The GAN system learns through training data of 81,500 examples of paintings which creates the foundation for knowledge of different artistic styles. Generative Adversarial Networks are composed of two AI neural networks: a generator and discriminator.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*lb8p6SLbfaV1kvpv.png" /><figcaption>Diagram of an Artificial Neural Network (ANN) Image courtesy of ResearchGate</figcaption></figure><p>The generator produces images for the discriminator to then analyze the image passed and decide whether to classify the image as output from the generator or a painting derived from the training set. Data scientists then feed noise into the generator and from there it relies upon the trained weights to produce the output. The discriminator trains through analyzing pre existing paintings created by humans (expected output is 1) and the art produced by the generator (expected output is 0). The rivalrous nature of the GAN system is designed to adjust and improve both models simultaneously — the generator adjusts its weights to improve performance based upon feedback provided by the discriminator meanwhile the latter becomes better at discerning fakes from reals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xGcqhSoB2RymMogb.jpg" /><figcaption>Diagram of a Generative Adversarial Network (GAN) Image Courtesy of GeeksForGeeks.</figcaption></figure><p>To train the model, the conventional process of art production with AI was altered: images that could be classified into preexisting paintings were rejected from use in the data. A move feasible through “maximizing deviation from established styles and minimizing deviation from art distribution” or to say that images that violated the terms (having been a preexistent painting) were intentionally curtailed.</p><p>The inherent beauty in Art lies beyond the outer layers of visual pieces though; art isn’t limited to a certain source. It’s an experience that transcends aesthetics. The scope of AI’s artistic ability is also extended to:</p><ul><li>Playwrighting</li></ul><blockquote><em>FLORIZEL:</em></blockquote><blockquote><em>Should she kneel be?</em></blockquote><blockquote><em>In shall not weep received; unleased me</em></blockquote><blockquote><em>And unrespective greeting than dwell in, thee,</em></blockquote><blockquote><em>look’d on me, son in heavenly properly.</em></blockquote><p>Plays tell stories — they unpack things of social importance and transform them into a general viewing experience. AI also has the capability to do this. Built with a Recurrent Neural Network and TensorFlow, playwrights may no longer be synonymous with being only human.</p><ul><li>The creation of poetry</li></ul><blockquote>“the sun rays struck my face warm tingles to my fingertips the light showed me a path should walk down i spoke and the whispers of the breeze told me to close my eyes i lost my way in a paradise”</blockquote><p>How do you train something unfeeling as a robot to pass off poetry? Something that even humans with all their sentiments and life experiences find notoriously difficult to translate feelings into words? Microsoft and Kyoto researchers were faced with this query as they embarked on a philosophically complex exploration to bridge word art and AI. Fed on image data with a combination of human provided descriptions/poems, the results were fruitful: when judges were presented with the poems created by Artificial Intelligence, discerning what was human and what was robot was not an undemanding task.</p><ul><li>The composition of music</li></ul><p>Trained on cosmic amounts of audio data, AI can learn musical theory and produce musical compositions. You can now pay for services that provide you with access to these sounds.</p><p>It isn’t too far of a cry to associate AI with art. In fact, robot art is <em>subjectively </em>(there’s that word again) more effective in the pursuit of beauty, a named main principle of art, than work created by humans. However, the belief that AI art is a weak imitation of the emotional expressions born into the world through humans may just be a direct result of our own biases. The presence of this thinly veiled prejudice was revealed in a social experiment where scientists took samples of human art <em>and </em>works by AI; unbeknownst to the test subjects. Most peculiarly, the AI art was declared by the human judges to be of higher novelty, complexity and inspiration.</p><h4>Conclusion</h4><p>I don’t foresee including many of my own personal opinions in my future articles, but it would leave me with a phantom itch if my thoughts weren’t fully expressed on this topic. When I began learning about AI a couple of weeks prior, the technology was exciting but the full scope of what this technology’s potential wasn’t revealed. I believed AI to be mechanical and extremely capable; the capability extending beyond the reach of humans, but still limited. They may be able to diagnose diseases better than trained doctors and give better editing suggestions than the typical writer, but lack the condition of being human, or so I thought. The beauty in sharing knowledge is that you also happen to learn. Throughout the process of writing this article, the full magnitude of what exactly AI can do finally hit albeit delayed. There is something so strange and magical yet structured and logical about this technology. AI runs on complex math, code, and data, but doesn’t simply wade in the shallows with non-esoteric tasks. The nature of this technology is designed to make us ruminate further about what makes us human, and that lies beyond skin and bones, code and data.</p><p>Resources:</p><p><a href="https://futurism.com/ai-now-produce-better-art-humans-heres-how">https://futurism.com/ai-now-produce-better-art-humans-heres-how</a></p><p><a href="https://towardsdatascience.com/machineray-using-ai-to-create-abstract-art-39829438076a">https://towardsdatascience.com/machineray-using-ai-to-create-abstract-art-39829438076a</a></p><p><a href="https://towardsdatascience.com/artificial-artist-can-artificial-intelligence-create-art-d7dd6ed98270">https://towardsdatascience.com/artificial-artist-can-artificial-intelligence-create-art-d7dd6ed98270</a></p><p><a href="https://www.theverge.com/2019/2/1/18192858/adobe-sensei-celsys-clip-studio-colorize-ai-artificial-intelligence-art">https://www.theverge.com/2019/2/1/18192858/adobe-sensei-celsys-clip-studio-colorize-ai-artificial-intelligence-art</a></p><p><a href="https://blogs.scientificamerican.com/observations/can-ai-create-true-art/">https://blogs.scientificamerican.com/observations/can-ai-create-true-art/</a></p><p><a href="https://www.cnn.com/style/article/artificial-intelligence-ai-art/index.html">https://www.cnn.com/style/article/artificial-intelligence-ai-art/index.html</a></p><p><a href="https://medium.com/towards-artificial-intelligence/ai-writes-shakespearean-plays-e0d5f30c16b2">https://medium.com/towards-artificial-intelligence/ai-writes-shakespearean-plays-e0d5f30c16b2</a></p><p><a href="https://arxiv.org/pdf/1804.08473.pdf">https://arxiv.org/pdf/1804.08473.pdf</a></p><p><a href="https://futurism.com/artificial-intelligence-bad-poems">https://futurism.com/artificial-intelligence-bad-poems</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbc8c6e951a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[More than Just Meat: Lab-Grown Meat is a Game Changer.]]></title>
            <link>https://tenzin-migmarr.medium.com/more-than-just-meat-lab-grown-meat-is-a-game-changer-64d4b05983d?source=rss-37529e2ae723------2</link>
            <guid isPermaLink="false">https://medium.com/p/64d4b05983d</guid>
            <category><![CDATA[pandemic]]></category>
            <category><![CDATA[cellular-agriculture]]></category>
            <category><![CDATA[sustainability]]></category>
            <category><![CDATA[vegan]]></category>
            <category><![CDATA[climate-change]]></category>
            <dc:creator><![CDATA[Tenzin Migmar]]></dc:creator>
            <pubDate>Sat, 19 Sep 2020 19:37:02 GMT</pubDate>
            <atom:updated>2020-09-19T19:37:02.206Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v8HK7cVjJ0dmLZUa.png" /><figcaption>Image courtesy of Gizmodo</figcaption></figure><p>Agriculture today is a modernized relic of the practices of the earliest humans. We’ve grown crops and raised livestock since the dawn of time, but is it also possible to grow meat? Lab-grown meat, also known as clean meat, is the product of animal flesh through a process known as vitro cultivation – the growth of cells and tissues in a controlled environment. The process begins by collecting myosatellite cell samples from the animal and it is from there that the selected samples are placed within an environment with the necessary nutrients and growth elements that are naturally present in animals. Scientists in the lab allow the cells to continue proliferating until trillions of cells are produced before restricting the growth elements which creates the phenomena of differentiation which later goes on to gradually compound into homogenized muscle fiber. A water-based gel combined with the contraction attribute that the muscle fibers have results in the new growth of muscle tissue which is not too alien from the meat we eat. The growth of meat in a selected environment is reliant on the ability of myosatellite cells to reproduce muscle tissue in case of damage to the tissue.</p><p>Vegetarian and vegan culture is known to hold ethics as the main principle, but that concept will also undoubtedly be subject to change if meat can be consumed sans-cruelty. Sans-cruelty can be translated differently but ultimately is dependent on the individual; some vegans and vegetarians opted to eliminate meat from their diets on the beliefs that other living things were not made for our consumption, while others were repelled by the inhumane conditions and maltreatment animals were subjected to prior to slaughter. Curious about vegans and vegetarians’ thoughts on ethical meat, I turned to the internet to garner responses. Most answered that they believed the food technology to be beneficial and wished to see the switch in meat consumers but remained unyielding in their own disdain for flesh. I had thanked them for their time until a couple of minutes later, a vegan replied in divergence from the common response .</p><h3>“ Unlike most of the vegans here, I would be willing to try this. I will admit that I had liked the taste of meat and would make the switch if there was zero harm to animals involved.”</h3><p>Livestock farms are notorious for animal cruelty and that is what has popularized vegetarian and vegan culture along with the allure of a healthier guilt-free lifestyle for some, but ethics isn’t the only pillar of reason for meat-free diets. Animal agriculture is also actively exacerbating the climate crisis.</p><p>Climate change has been fuelled by the agricultural industry through various mediums due to the demanding conditions required to raise livestock like land space. Bloomberg states that 41 percent of American land is used for animal agriculture while a collective 26 percent of the earth’s terrestrial surface is used for livestock grazing. That’s before we take into account the intensive resource use consumed by animals before slaughter. A cosmical amount of water is consumed by cows which can be ascribed to their size; according to UNL Beef, water consumption varies individually but generalized, cows drink a gallon of water per 100 pounds in cold weather, and two gallons per 100 pounds in warm weather per day. Lactating cows require an estimated double that amount. Cows weigh an average of approximately 1200 pounds which would result in a consumption of 24 gallons of water per cow in warm weather. The environmental damage extends beyond just consumption, the gases released by livestock through burping or farting are potent greenhouse gases that contribute to trapping the heat energy from leaving the atmosphere. Animal agriculture alone is responsible for an exuberant 14.5 per cent of all anthropogenic greenhouse gas emissions. In addition, the staggering amount of land space for grazing land and livestock farms require entire forests of trees that may have otherwise served as a carbon sink to be cleared away. Demand for meat is continuously growing with the world population and we need to implement new technology into agriculture to make the process more efficient and sustainable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*ptQxd_6SewjUZstk.jpg" /><figcaption>Cows grazing land space. Image courtesy of Grit.</figcaption></figure><p>Science like this is transformative and multifaceted; it disrupts entire established cultures but isn’t limited to that: advanced technologies not only broaden our ability to solve big problems but also prevent them, like the coronavirus pandemic. Poor farm conditions which are not entirely uncommon or unheard of create a ripe environment for viruses and diseases to proliferate; infectious disease experts and epidemiologists warn that our next pandemic may be sourced from farm animals. Our current food systems are designed to host pathogens through farming models like concentrated animal feeding operations where thousands of (and often more) livestock share crowded living situations and that enables viruses to jump from one host to the next. The collection of genetic codes may be benign but once it has secured a host the virus replicates itself from there on and, although unlikely, it may mutate and continue to spread through the unassuming throngs of tightly packed animals. From there, it would not take too long for the virus to come into contact with humans. A variant of viruses are genetic code segmented parts composed together but if it were to come into contact with another of that kind through co-infecting a cell it would be possible that the offspring virus produced has properties neither of the parents had and CAFOs that house thousands of animal hosts make that scenario more than feasible. Our animal agricultural industry and the systems that get the meat to dinner plates are, by design, the perfect breeding grounds for a nasty new virus.</p><p>It is in our nature as humans to advance all creations of life and although some may believe cellular agriculture to encroach on nature’s design, our innate desire to make life more efficient has no limits. The meat we consume today is devoid of advanced technology, wasteful, contributes to and spawns problems, and is unethical, while the meat of tomorrow has the ability to transform even the most rigid attitudes about meat. Cellular agriculture’s stroke of genius doesn’t lie in simply advancing an ancient practice or human ethos, but because it’s tangible proof that our problems and solutions are often intrinsically interconnected with each other. It is technology like this that unlocks our ability to dynamically apply solutions to various issues in the world.</p><h4>Sources:</h4><p>https://www.mosameat.com/technology</p><p>https://www.youtube.com/watch?v=hwuujiHvduc&amp;t=65s</p><p>http://www.fao.org/news/story/en/item/197623/icode/</p><p>https://beef.unl.edu/amountwatercowsdrink</p><p>https://www.smithsonianmag.com/travel/is-the-livestock-industry-destroying-the-planet-11308007/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64d4b05983d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>