<?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 Naomi Alterman on Medium]]></title>
        <description><![CDATA[Stories by Naomi Alterman on Medium]]></description>
        <link>https://medium.com/@nlalterman?source=rss-ace39bc06907------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0hNgb6oTRkuyKvizDoIVYw.png</url>
            <title>Stories by Naomi Alterman on Medium</title>
            <link>https://medium.com/@nlalterman?source=rss-ace39bc06907------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 03:57:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nlalterman/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[Ethical Storyboarding for Machine Learning]]></title>
            <link>https://medium.com/data-science/ethical-storyboarding-for-machine-learning-7c5b5a031173?source=rss-ace39bc06907------2</link>
            <guid isPermaLink="false">https://medium.com/p/7c5b5a031173</guid>
            <category><![CDATA[ethics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[pedagogy]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[teaching]]></category>
            <dc:creator><![CDATA[Naomi Alterman]]></dc:creator>
            <pubDate>Fri, 10 May 2019 15:40:21 GMT</pubDate>
            <atom:updated>2019-05-13T17:32:02.692Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-sa/4.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_aQEh2V0jCVEcIiVDWmopQ.jpeg" /><figcaption>[A comic-style storyboard with scenes of technical ML content and human-machine interactions]</figcaption></figure><h4>Picturing the systems we build within the systems we live</h4><p>Machine learning is gradient-descending its way into more and more places, and with its arrival comes both increasing demand for skilled ML practitioners and increasingly disruptive challenges to the basic assumptions we hold about our society. The truth is, ML is fast becoming too deeply integrated into our world to keep engineering and ethical concerns separate from each other, and to survive the wave it’s creating we’re going to need a <a href="https://medium.com/swlh/my-fellow-engineers-it-is-time-for-the-greatest-invention-of-all-f738d8394998">workforce</a> that is acutely aware of how its work <a href="https://www.nytimes.com/2019/05/09/opinion/sunday/chris-hughes-facebook-zuckerberg.html">ripples</a> <a href="https://arstechnica.com/tech-policy/2017/12/bitcoins-insane-energy-consumption-explained/">through</a> <a href="https://www.mv-voice.com/news/2018/11/30/los-altos-planning-commissioner-arrested-for-tesla-dui">the surrounding world</a>. Where better to start increasing this awareness than the classroom?</p><p>This spring I co-taught the pilot for Google’s new <a href="https://edu.google.com/computer-science/applied-computing-series/intensive.html">Applied Machine Learning Intensive bootcamp</a> at Mills College, a program which brought together recent college grads of all different majors and backgrounds to introduce them to a wide breadth of foundational ML techniques. Google was gracious enough to give me the flexibility to try out some integrative approaches to teaching engineering and ethics, and like the output of a well-tuned neural network, the results were electrifying.</p><h4>The current state of the art</h4><p>Back when I was an engineering undergrad at Stanford, we were required to take two “engineering citizenship” requirements to round out our technical knowledge with a little bit of self-reflection.</p><p>One of these requirements was the <em>Writing-in-Major</em> seminar, a rushed and unfortunate one-unit afterthought of a course centered on critiquing homework assignments from our digital design lab. Class time mostly focused on the importance of decorum when presenting our opinions, and the primary criteria for our writing was enough self-restraint to keep from cursing out our professor (the average grade was surprisingly low). The other requirement, <em>Technology in Society</em>, had us enroll in any class from Stanford’s <em>Science and Technology in Society</em> department. These classes were highly abstract and intellectually formal in ways that made students used to applied engineering content feel like they were trapped in the depths of an <a href="https://www.theonion.com/professor-sees-parallels-between-things-other-things-1819569111">Onion article about academia</a>. We were arrogant, hungry engineering undergrads missing the gravity of the subject in a hurricane of academic posturing. Fast forward a decade — the pedagogy and technology of our STEM classrooms has improved immensely, and yet...</p><p>At the outset of our ML bootcamp I was relieved to see Google had blocked out an early unit dedicated to the subject of “ML Fairness and Bias”. Cool! That’s a great start, but something about it was still nagging me: it was just another <em>Writing-In-Major </em>seminar<em>. </em>The truth is, a single unit in an introductory ML class about bias is like thoughts and prayers after a tragedy — it sounds nice but abdicates our responsibility to systemically heal the problem.</p><h4>Let’s talk integrative methodology</h4><p>The main principle behind our modifications to the ethical unit of this course was that it should be a recurring,<em> constantly present </em>aspect of the engineering process, the same way we treat debugging and testing. Research has shown the value of <a href="https://doi.org/10.1145/1508865.1508921">integrating “test-first” exercises into foundational CS assignments</a>, and our hope was to have similar results with a “bias-first” approach to an ML course: as students build their mental muscle memory for exploring and wielding a dataset within an engineering context, they should also be developing a reflex to ethically analyze their solutions.</p><p>What we arrived at for this semester was an “Ethical Storyboarding” worksheet: a writing exercise asking students to concretely picture both positive and negative consequences of an ML algorithm trained on a given source of data, and then brainstorm different ways to alter their designs given their analysis. The questions were structured to pattern a few specific behaviors that we felt were important to see in principled and competent engineers:</p><ul><li>Keeping possible negative repercussions of your project in mind from the very start, rather than sweeping them under the rug or paying lip service to them after all the technical work is done</li><li>Brainstorming fixes to deal with problems across <em>multiple dimensions</em> of the engineering process — and not just technical ones</li><li>Feeling safe to discuss negative, possibly project-stopping concerns, while also entering into the conversation with avenues to move the team forward.</li></ul><p><em>Whenever</em> students encountered a new dataset, they were required to fill this worksheet out. Early on, while students were all working on the same data, we also followed this written work with an in-class discussion to debrief students on the exercise. One of the primary roles of these early discussions was to emphasize the importance of ongoing reflection and iteration, rather than to “engineer-ize” the ethical questions at hand (something that broad surveys of engineering curricula have <a href="https://doi.org/10.1007/s11948-004-0030-8">found to be a recurring problem</a>). We <em>really don’t want </em>students to learn to apply technical band-aids to “solve” bias. That’s possibly the most dangerous takeaway one could get from this exercise, and extra care should be taken by the instructor to address it.</p><h4>The Ethical Storyboarding worksheet</h4><p>Presented here is the worksheet as given to our students, with a toy example filled in to demonstrate the form and level of content expected from students in an introductory Machine Learning course.</p><ul><li>Describe your <strong>dataset</strong></li></ul><blockquote>We chose the MNIST database of handwritten digits (<a href="http://yann.lecun.com/exdb/mnist/">http://yann.lecun.com/exdb/mnist)/</a>, a collection of 60000 images of hand-written arabic numerals.</blockquote><ul><li>Write a one-paragraph story describing a fictional person who was <strong>positively affected</strong> by a model trained with this data</li></ul><blockquote>Riley is a doctor who spends most of their time with patients figuring out how to enter data into whatever current electronic medical record software their practice has contracted to use. After the latest update, they decide to switch to free-form note taking software that lets them write medical records on their tablet in whatever form they like, and uses OCR with numeral recognition trained on MNIST to make these records searchable and copyable. Now, they can focus more on attending to their clients’ needs and never have to understand a new hairbrained UI again!</blockquote><ul><li>Describe at least two <strong>sources of bias</strong> the particular model in your story could have</li></ul><blockquote>Upon research we found that the MNIST dataset was compiled from the handwriting of both Census Bureau employees and high school students (we could not find further demographic information about either group). While there are hundreds of different writers represented in the dataset, it’s entirely possible that there are substantive differences in handwriting between on-the-job medical practitioners and the cross-section of people represented by MNIST . Additionally, because most MNIST-based ML benchmarks use the dataset in isolation, it’s unclear whether the introduction of alphabetical characters or markup could make MNIST-trained networks less accurate</blockquote><ul><li>Describe at least one way we could <strong>modify the model</strong> to mitigate this bias<br><em>Eg, what can we do when designing our model to account for inherent bias in its input data?</em></li></ul><blockquote>We could use a classifier on top of the normal recognition network to determine whether a region is likely to be a number or a word, and use this information to weight the final character class probabilities outputted from the OCR model. It is unclear to us how to address the problem of poor handwriting recognition by solely altering our software alone — that would seem to require deeper changes to the training data itself.</blockquote><ul><li>Describe at least one way we could <strong>modify the dataset</strong> to mitigate this bias<br><em>Eg, what could we do differently if we collected this data again?</em></li></ul><blockquote>We could make sure to build the OCR dataset from the handwriting of doctors, and also make sure that handwriting includes examples of the full range of letters, numerals, and symbols we might see in an average medical record.</blockquote><ul><li>Describe at least one way we could <strong>modify the context</strong> surrounding the model to mitigate this bias<br><em>Eg, what human practices or policies could we put in place to protect people within the social system where this model is used?</em></li></ul><blockquote>We could institute a strict record release policy such that whenever data is transferred from the doctor’s hand-written notes to a pharmacy or other specialist, a human being reviews the data to make sure all relevant records are included in the release and that all figures copy-and-pasted out of them are accurate.</blockquote><ul><li>Write a one-paragraph story describing a fictional person who was <strong>negatively affected</strong> by a model trained with this data</li></ul><blockquote>Taylor is one of Riley’s patients, and begins experiencing focal seizures after their 20th birthday. Riley prescribes them the anti-seizure generic Levetiracetam at the maximum dose of 3000 mg/day, but an OCR failure interprets the 3 as an 8 and goes uncaught by the pharmacist. Taylor develops acute medication poisoning, spends a night in the ER, and now has staggering medical debt to pay back on top of their general insurance premiums and outstanding student loans.</blockquote><h4>The worksheet, in practice</h4><p>We introduced this worksheet early in the semester, shortly after playing with toy linear regression examples but before they worked with any real-life data. They split off into groups of three, browsed what was available on <a href="https://www.kaggle.com/datasets">Kaggle</a>, and filled out a storyboard for the the most intriguing dataset they could find. Their work ranged from subtle and chilling (like an ethnic restaurant disproportionately saddled with financial burden due to racism-motivated food safety fears) to hysterically funny (like a fledgling cannabis user being dissuaded from further drug use due to an improper suggestion for a powerful strain called “<em>Strawberry Cheesecake</em>”).</p><p>We found that, understandably, students had incredibly varied comfort levels with regards to this exercise: some students responded with panic at the request for a “story”, while others had trouble figuring out exactly how to connect a technically esoteric dataset to a real-life narrative. Almost all students needed clarification for the prompt asking students modify the social context their technologies were used in. In retrospect, possibly the most important improvement to note for future iterations of this assignment would be to write an example storyboard in front of the class, styled much like a live-coding session one might do for a new programming technique. Asking students to fill in details as the instructor types, <em>Mad Libs</em>-style, could add a fun interactive dimension to this instructional component.</p><p>We also saw that students’ early answers to bias mitigation questions tended to range from highly general hand-waving to “quick-fix” type solutions, although their work improved throughout the semester as their work became more hands-on. We feel that dedicated one-on-one support and guidance to “workshop” these storyboards, beyond the class-wide discussions, is of great value here.</p><p>One beneficial use we found for this worksheet beyond just its ethical dimension was as a diagnostic tool to identify students having trouble connecting the technical dots into a bigger, more <em>applied</em> picture. Asking them to build a concrete map between a dataset, the technical tools they were learning, and a real-life use case provided some ample opportunities for us to identify and fill in the gaps. This exercise in design thinking proved important later in the semester, when students were beginning their self-directed final projects: we found that, as this ethical framework was their first experience brainstorming <em>anything </em>to do with ML, many of them were instinctively using it as a means to start ideating their project’s content.</p><h4>Our future depends on reflection</h4><p>In Canada, most students graduating with an engineering degree attend a <a href="http://www.ironring.ca/"><em>Calling of the Engineer </em>ceremony</a>, in which they recite a passage emphasizing the social responsibility of their profession and are presented with an iron ring to carry throughout their lives. These rings, a reminder of their societal obligation, are of course no better than a stand-alone unit on ML bias, or a single semester of engineering ethics, or even a survey course full of ethical worksheets. All the same, there is something about them that I find beautiful: they’re an enduring and on-going presence, at once a piece of jewelry worn with pride over our achievements, and also a weighted burden reminding us of how our work ricochets throughout our world. This sentiment is the heart of what we hope to convey through our curriculum.</p><p>We don’t pose this worksheet and its associated pedagogical methodology as a prescriptive solution for an ethical engineering education — it might not even <em>resemble</em> a proper solution. Rather, we are sharing it with the intent to spark your interest in adopting more ethical content in your own technical coursework; to convince you to <em>closely integrate </em><strong><em>doing</em></strong><em> with </em><strong><em>questioning</em></strong>. The authors of that study espousing test-first CS assignments found that while it didn’t substantively affect students’ project grades, it did measurably improve their ability to test code. It wasn’t of value for teaching first-semester programming, but rather for being a well-rounded software engineer. As they put it:</p><blockquote>If curricula can get students ‘test-infected’ from the beginning, we believe they are likely to realize that testing is an integral part of programming, benefitting <em>[sic]</em> them throughout their academic and professional careers.</blockquote><p>What a wonderful sentiment! Let’s try to get students ‘ethics-infected’ as well. For those of you inspired to do something like this in your course, and for those of you already miles ahead of us doing similar work, my heart sings — let’s start a conversation about this, and let’s make it loud.</p><p><em>Naomi Alterman is a freelance CS educator and software engineer who loves having conversations with people about ways to think about things. If you do too, you should drop her a line, she’ll be jazzed about it. Her contact info can be found at </em><a href="https://www.nlalterman.com/"><em>www.nlalterman.com</em></a><em>, and her twitter handle is </em><a href="https://twitter.com/uhohnaomi"><em>@uhohnaomi</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7c5b5a031173" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/ethical-storyboarding-for-machine-learning-7c5b5a031173">Ethical Storyboarding for Machine Learning</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[Introducing the Canvas 2D Context API for Expo]]></title>
            <link>https://blog.expo.dev/introducing-the-canvas-2d-context-api-for-expo-8ba6106ed8e5?source=rss-ace39bc06907------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ba6106ed8e5</guid>
            <category><![CDATA[expo]]></category>
            <category><![CDATA[webgl]]></category>
            <category><![CDATA[graphics]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Naomi Alterman]]></dc:creator>
            <pubDate>Wed, 28 Nov 2018 00:20:49 GMT</pubDate>
            <atom:updated>2018-11-28T00:20:49.336Z</atom:updated>
            <content:encoded><![CDATA[<h4>A pure JS+WebGL implementation of the canvas 2D API</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WbkHCkUSSwwILRdnIApLbg.jpeg" /></figure><p>We are excited to announce we’re bringing support for the web’s 2D canvas API to Expo with the npm package ‘expo-2d-context’, a pure-JS art library that can be run on top of both Expo Graphics and a browser WebGL context.</p><p>This library strikes a nice balance between a simple no-fuss way to throw some shapes on the screen and a complex toolset for diehard graphics hackers, and is perfect for generative code art or a fledgling programmer’s first video game. With this package, you can use the wealth of pre-existing canvas libraries and tutorials already out there directly in your Expo app.</p><h3>Basic Usage</h3><p>Install the <a href="https://www.npmjs.com/package/expo-2d-context">npm package</a>, create a GL context by whatever mechanism your environment provides, and then pass it to a new instance of the Expo2DContext class. After that, use said instance as you would in a web browser:</p><pre>import { GLView } from &#39;expo&#39;;<br>import Expo2DContext from &#39;expo-2d-context&#39;;<br>import React from &#39;react&#39;;</pre><pre>export default class App extends React.Component {<br>    render() {<br>        return (<br>          &lt;GLView<br>            style={{ flex: 1 }}<br>            onContextCreate={this._onGLContextCreate}<br>          /&gt;<br>        );<br>    }<br>    _onGLContextCreate = (gl) =&gt; {<br>        var ctx = new Expo2DContext(gl);<br>        ctx.translate(50,200)<br>        ctx.scale(4,4)</pre><pre>        ctx.fillStyle = &quot;grey&quot;;<br>        ctx.fillRect(20, 40, 100, 100);<br>        ctx.fillStyle = &quot;white&quot;;<br>        ctx.fillRect(30, 100, 20, 30);<br>        ctx.fillRect(60, 100, 20, 30);<br>        ctx.fillRect(90, 100, 20, 30);<br>        ctx.beginPath();<br>        ctx.arc(50,70,18,0,2*Math.PI);<br>        ctx.arc(90,70,18,0,2*Math.PI);<br>        ctx.fill();</pre><pre>        ctx.fillStyle = &quot;grey&quot;;<br>        ctx.beginPath();<br>        ctx.arc(50,70,8,0,2*Math.PI);<br>        ctx.arc(90,70,8,0,2*Math.PI);<br>        ctx.fill();</pre><pre>        ctx.strokeStyle = &quot;black&quot;;<br>        ctx.beginPath();<br>        ctx.moveTo(70,40);<br>        ctx.lineTo(70,30);<br>        ctx.arc(70,20,10,0.5*Math.PI,2.5*Math.PI);<br>        ctx.stroke();<br>        ctx.flush();<br>    }<br>}</pre><p>Note that unlike normal 2D context implementations, this one assumes it’s drawing within a buffered environment, and thus you need to call the context’s flush() method when you want to actually update the screen.</p><p>To use the API’s font drawing functions, first call ctx.initializeText(), which will load the necessary resources. After that, it&#39;s business as usual:</p><pre>await ctx.initializeText()<br>ctx.fillStyle = “blue”;<br>ctx.font = “italic 72pt sans-serif”;<br>ctx.fillText(“Hey Galaxy”, 10, 200);<br>ctx.flush();</pre><h3>When to use (and not use) expo-2d-context</h3><p>This library is a great way to draw custom UI elements and ambient animations for your app. It’s also great for simple games and visually interactive applications that also integrate native platform features. That is, it’s good in situations where you want a quick and powerful set of drawing commands but don’t want to create a WebView widget just to scrounge together a DOM with a lone canvas tag. This allows much smoother and responsive interactions between your app’s logic and your rendering code, something WebView-based rendering methods can struggle with.</p><p>That said, this implementation is currently slower than a browser’s native 2D context implementation and although its performance should be more than enough for UI and simple video games, those interested in a higher-performance version of this API may prefer to use the WebView rendering engine’s native canvas implementation.</p><p>Applications aside, this library will hopefully also serve as a learning tool and alternative implementation to an API that exists mostly only in large rendering engine codebases.</p><h3>Contributing and testing</h3><p>To report issues with this library, or help out with its development, check out the repo on github:</p><p><a href="https://github.com/expo/expo-2d-context">https://github.com/expo/expo-2d-context</a></p><p>We use the W3C’s conformance test suite to ensure the library is functioning as expected. A modified version of their test suite sits in the repo’s test directory, and can be run in both browser and Expo environments. For the current state of the test suite, check here:</p><p><a href="https://circleci.com/gh/expo/expo-2d-context/tree/master">https://circleci.com/gh/expo/expo-2d-context/tree/master</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ba6106ed8e5" width="1" height="1" alt=""><hr><p><a href="https://blog.expo.dev/introducing-the-canvas-2d-context-api-for-expo-8ba6106ed8e5">Introducing the Canvas 2D Context API for Expo</a> was originally published in <a href="https://blog.expo.dev/">Exposition</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>