<?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 Kevin Li on Medium]]></title>
        <description><![CDATA[Stories by Kevin Li on Medium]]></description>
        <link>https://medium.com/@yutengli?source=rss-e3bdb4f4b4d1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*UV9CzhmDse3vMF2I80Bg7w.jpeg</url>
            <title>Stories by Kevin Li on Medium</title>
            <link>https://medium.com/@yutengli?source=rss-e3bdb4f4b4d1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 06:26:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yutengli/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[Review — Deep Domain-Adversarial Image Generation (AAAI 2020)]]></title>
            <link>https://yutengli.medium.com/review-deep-domain-adversarial-image-generation-aaai-2020-8ee5eb596a4f?source=rss-e3bdb4f4b4d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ee5eb596a4f</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[domain-generalization]]></category>
            <category><![CDATA[paper-review]]></category>
            <category><![CDATA[adversarial-training]]></category>
            <dc:creator><![CDATA[Kevin Li]]></dc:creator>
            <pubDate>Tue, 20 Apr 2021 08:22:35 GMT</pubDate>
            <atom:updated>2021-04-20T08:22:35.638Z</atom:updated>
            <content:encoded><![CDATA[<h3>Review — Deep Domain-Adversarial Image Generation (AAAI 2020)</h3><h4>Guiding the model to forget the domain but retain its label information</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f9H0cKPwk-but_KQyQxgeQ.png" /><figcaption>DDAIG overall model</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zo56mLvtYAVwDL7B1EHErA.png" /></figure><p>Deep Domain-Adversarial Image Generation for Domain Generalization (referred to as DDAIG henceforth) trains a <strong>conditional generator</strong> that produces perturbed images from source domains, so as to fool the <strong>domain classifier</strong>, but learn the <strong>label classifier</strong>. The model is similar to the classic GAN structure except that it’s conditioned on the source image, and it has two discriminators (that performs multi-class classification, not binary). DDAIG prevails over almost all other models that use meta-learning methods or domain-alignment methods. Experiments performed on image and digit classification, as well as person re-id task.</p><h3>Intuition</h3><p>If we break down the problem of domain generalization to its foundation, what we actually want is a strong classifier for <strong>ALL</strong> distributions / domains. In that case, the classifier doesn’t even <em>need</em> the notion of domains (i.e. should not learn any information relevant to domains specifically). That’s exactly what the model this paper proposed, DDAIG, is doing — train a model to forget about <strong>domains</strong>, but keep the information about the <strong>labels</strong>. With this intuition in mind, adversarial training seems like a straightforward tool, but any other design that makes the model “forget the domains, learn the labels” goes down the same path.</p><h3>Method</h3><p>As shown at the very beginning of this post, the structure of DDAIG contains one Domain Transformation Net (called the DoTNet in the paper), which adds perturbation onto the source domain images, and two classifiers for label and domain classification, respectively. All the three mentioned structures are Neural Nets.</p><p>The training flow is presented as the following. All loss functions <strong><em>J </em></strong>in this paper are cross-entropy losses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yV9frfqTNR_bK7xw90LsQg.png" /></figure><h4>DotNet (Domain Transformation Network)</h4><p>DoTNet generates perturbations the input image instead of synthesizing images from scratch (as in GANs).The structure of DoTNet in this paper is based on Fully-convolutional Network (<a href="https://www.cv-foundation.org/openaccess/content_cvpr_2015/papers/Long_Fully_Convolutional_Networks_2015_CVPR_paper.pdf">FCN</a>) but any feature extractor can theoretically make sense. The perturbed image is generated as the equation below where <strong>λ</strong> is a positive hyperparameter typically between 0.1 and 0.7.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/792/1*jHk_6dijjBwR-Fp3NdmuBw.png" /><figcaption>Perturbation added on input image x</figcaption></figure><p>Note that the perturbation here is learnt by the neural net instead of being calculated as in some adversarial attack methods. The loss function of DotNet will be the addition of label-classifier’s loss and <strong><em>negative</em></strong> domain-classifier’s loss (remember we want to increase the loss of the domain-classifier).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ZVxUZLUXwRyt3VyKhborQ.png" /></figure><h4>Label Classifier and Domain Classifier</h4><p>The “classifier” name here is somewhat misleading. Both label and domain classifiers are in fact comprised of a <strong>feature extractor</strong> and a <strong>classifier</strong>. Again, the choice of structure does not matter in theory. As a guideline, in the <a href="https://github.com/KaiyangZhou/Dassl.pytorch">official repo</a> the team used <strong>ImageNet-pretrained ResNet-18</strong> for PACS experiments. The domain classifier network performs <strong>multi-class classification </strong>(instead of just predicting real or fake) such that the model does not simply force images from one source domain to <strong><em>another</em></strong> source domain. The loss function for both classification networks are shown bellow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ub98Ysx-BvV8DdxXpy6YUw.png" /></figure><p>Now let’s look at the training procedure overall. As in classic GAN training, within <em>each </em>iteration, DDAIG first updates the DoTNet and then the two classifiers. One trick here is that for the first few iterations, it’s better to warm up the label classifier so that the competition later is meaningful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ia0h41JRAhKYJWUOvflBA.png" /><figcaption>Full Algorithm of DDAIG</figcaption></figure><h3>Result and Discussion</h3><p>This paper evaluates their model on <strong>Digit-DG</strong> benchmark (MNIST, MNIST-M, SVHN, and SYN datasets), <strong>PACS</strong> benchmark, and <strong>Office-Home </strong>dataset for the homogeneous DG setting. <strong>Person re-ID</strong> task (DukeMTMC-reID and Market1501 dataset) is used for testing on the heterogeneous setting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k3IjKVTiv3ZD-jhitSF_aQ.png" /><figcaption>Dataset example</figcaption></figure><p>All three homogeneous DG settings followed the “leave one domain out” fashion for domain split. Below we’ll discuss the result of PACS and Office-Home dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GoaMtRhSIWoWKl2WA9uAIw.png" /><figcaption>Result on PACS and Office-Home dataset</figcaption></figure><p>Let’s first look at the <strong>PACS</strong> dataset result, which is the most popular benchmark for DG experiments. The margin of improvement was a solid 2.4% between DDAIG and the state-of-the-art by then, and a 3.6% improvement from naive multi-domain training. To me, this result indicates that the simple intuition of DDAIG actually is a promising direction for further research in DG. On the other hand, <strong>Office-Home</strong> is a dataset with smaller domain shift, but much more classes (<strong>65 classes </strong>for each of the <strong>4 domains</strong>). Thus we see in Office-Home experiment, the vanilla model provides a much more competitive result compared to that in PACS. However, it’s worth noticing that in a smaller domain-shift setting, the advantage of DDAIG over vanilla model is no longer that obvious.</p><h4>Thought: Data Augmentation that helps model generalize.</h4><p>Before DDAIG, most papers focus meta-learning and domain-alignment methods. There were a number of data augmentation methods though, such as to augment images by adversarial attack, but none has exhibited promising results are DDAIG did. Later after this paper, meta-learning methods tend to appear less, whereas many augmentation-based methods surged with increasing performance. So here’s the question: <strong>Is the next step for DG research either on data or representation ?</strong> Considering the outburst of self-supervised representation learning papers last year (2020), I’m excited to see how SSL may facilitate the improvement on DG.</p><p>Happy coding!</p><p><a href="https://yutengli.medium.com/paper-review-series-domain-generalization-9ebf63673e5c">Paper Review Series— Domain Generalization</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ee5eb596a4f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Review — MetaReg (NeurIPS 2018)]]></title>
            <link>https://yutengli.medium.com/review-metareg-neurips-2018-2a35d0ab2ed0?source=rss-e3bdb4f4b4d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2a35d0ab2ed0</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[domain-generalization]]></category>
            <category><![CDATA[paper-review]]></category>
            <category><![CDATA[metareg]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Kevin Li]]></dc:creator>
            <pubDate>Wed, 14 Apr 2021 02:50:33 GMT</pubDate>
            <atom:updated>2021-04-14T03:00:27.305Z</atom:updated>
            <content:encoded><![CDATA[<h3>Review — MetaReg (NeurIPS 2018)</h3><h4>Classifier-based domain generalization method</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfZiOwwMTP3nnxkUpNOhYg.png" /></figure><p>More posts about <strong>domain generalization</strong> here.</p><p><a href="https://yutengli.medium.com/paper-review-series-domain-generalization-9ebf63673e5c">Paper Review Series— Domain Generalization</a></p><p>For anyone interested in reading this paper, I highly recommend to also read the <em>Understanding deep learning requires rethinking generalization </em><a href="https://arxiv.org/abs/1611.03530">paper</a> to get a full picture on when regularization can/cannot promote generalization.</p><p>MetaReg attempts to solve DG problems by applying <strong>meta-training</strong> on a <strong>regularizer</strong>. Different from most papers, which either the train the entire “feature extractor — classifier” pipeline or just the feature extractor, this paper aims to train a <strong>classifier </strong>to promote generalization. Results are evaluated on both Computer Vision and Natural Language Processing fields (sentiment analysis).</p><h3>Intuition</h3><p>Traditionally, training-testing distribution mismatch can be mitigated by regularization (<strong>weight decay)</strong> if overfitting is present, since it discourages the model from learning an over-complicated decision boundary. This method often works well since both training and validation/testing sets are from the same distribution, but what about <strong>out-of-distribution</strong> mismatch? It’s not clear how we could “smoothen” the decision boundary across distinct domains. Well, then <strong>why not make a Neural Net learn the regularization</strong>?</p><h3>Method</h3><p>MetaReg deals with <strong>homogeneous</strong> DG problems, by meta-training a regularizer. At the beginning of model training, we divide the dataset into <strong><em>p</em></strong> source domains, and <strong><em>q</em></strong> target domains that are not accessible during training. The entire training process involves <strong>one </strong>shared feature extractor, and <strong><em>p</em></strong> classifiers (generically called <strong>task networks</strong> in the paper), one for each of the source domains, but ultimately what we want is the <strong>shared regularizer <em>R</em>(<em>θ</em>)</strong> <strong>across all <em>p</em> domains</strong>. The learnt regularizer is basically a weighted L1 norm, where the weights are learnable parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*F8KGzeCBB6HU9-TRxHtVHQ.png" /><figcaption>Network architecture</figcaption></figure><p>So how do we <em>actually</em> <em>train</em> a regularizer ? In each iteration, training includes the following 3 steps:</p><ul><li><strong>Update baseline model (MDL)<br></strong>We start by a naive <strong>multi-domain learning</strong> model as a baseline with a standard cross-entropy loss.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kigJvaASpAPSJOY0V0mQww.png" /><figcaption>Loss function for naive multi-domain training across all source domains</figcaption></figure><ul><li><strong>Episode creation<br></strong>Based on the MDL model, we randomly select two distinct domains <strong>(<em>a, b</em>)</strong> from all <strong><em>p</em></strong> source domains as our meta-train and meta-test pair.</li><li><strong>Regularizer Update<br></strong>In the pseudocode below, the first and second line are for <strong>meta-train</strong>, while the third and forth are for <strong>meta-test</strong>. <strong><em>β </em></strong>denotes the variable that holds the meta-updated classifier weight. For example, the first line of code below means that at iteration <strong><em>k, </em></strong>initialize <strong><em>β </em></strong>at the first time-step as <strong><em>θ </em></strong>from domain <strong>a</strong>. During meta-train, <strong><em>β </em></strong>is updated using both cross-entropy loss and the regularizer <strong><em>R</em>(<em>θ</em>)</strong><em> </em>for <strong><em>l</em></strong> time-steps. Then during meta-test, we assign the <strong>classifier</strong>’s weight with <strong><em>β</em></strong> (line 3), and then update the regularizer weights <strong><em>φ</em></strong> (line 4) based on the meta-updated <strong><em>θ, </em></strong>before proceeding to the next iteration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ejoSkM1lQuXSl5YxN12Aw.png" /><figcaption>Meta-learning for the regularizer</figcaption></figure><p>The overall training procedure thus looks like this. <strong>Line 2–7</strong> corresponds to baseline model update,<strong> line 8</strong> is creating the episode,<strong> line 10–14 </strong>corresponds to the meta-train phase for our regularizer <strong><em>R</em>(<em>θ</em>)</strong>, and <strong>line 15–16 </strong>denotes the meta-test phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ccnl8tQ44eai-dcO8qdB1A.png" /><figcaption>Final training procedure</figcaption></figure><p>Now we get our regularizer fully trained, we can then apply it <strong>any</strong> conventional “feature extractor — classifier” pipeline for tasks on the target domains.</p><h3>Result and Discussion</h3><p>The team evaluates <strong>MetaReg</strong> on the <strong>PACS</strong> dataset (photo, art paintings, cartoon, sketch), and sentiment classification on <strong>Amazon Reviews</strong> dataset. Here we will focus only on the PACS experiment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8ByHQxGkrnRehguYkPFGfg.png" /><figcaption>Result on PACS dataset</figcaption></figure><p>For the PACS experiment, it also follows the “one held-out” rule for domain split (for example, domain <strong><em>P</em></strong> as the target, and domain <strong><em>A,C,S</em></strong> as the source). We can see that on average MetaReg prevails MLDG by a solid 2.6%, which indicates that explicit regularization can be able to solve DG problems.</p><h4>Thought: Does explicit regularization actually help generalization</h4><p>This is the question that I have while reading. Sometimes in deep learning research literature, I find the explanation somewhat a <em>rationalization</em> simply based on their observably better result. Specifically, I was wondering whether explicit <strong>regularization</strong> <em>makes sense</em> to be an improvement direction (this is sort of a hindsight because after MetaReg, I don’t recognize any paper that approaches DG with regularization-based method).</p><p>In ICML 2017, the <a href="https://arxiv.org/abs/1611.03530">paper</a> mentioned above indicated that <strong>deep neural nets </strong>can <strong>memorize the entire dataset</strong> <strong>that contains absolutely no pattern </strong>(in technical terms, the <strong>effective capacity</strong> of some reasonable models, such as Inception and AlexNet, can <a href="https://en.wikipedia.org/wiki/Vapnik%E2%80%93Chervonenkis_dimension">shatter</a> most of the datasets). The paper conducts 5 types of randomization tests, such as random labels, or even random pixels, to emphasize the result.</p><p>Intuitively, if we first train a neural net on CIFAR-10 till convergence, and then use the same set of hyperparameters to train on the <strong>same dataset with randomized labels</strong>, one would probably expect the model to fail converging during <em>training </em>because there is <em>absolutely no pattern </em>present. Surprisingly, the model can converge without too much trouble, while its generalization performance is unsurprisingly bad. This leads to the emphasis of the paper:</p><blockquote>Neural Net is capable of memorizing the dataset, and explicit regularization does not improve the generalization performance.</blockquote><p>If the claim holds true, does it imply that MetaReg is <strong>actually overfitting</strong> to source domains, but not (substantially) generalizing to the target domain? Could the improvement that the paper demonstrated simply be attributed to the similarity of domains (i.e. small domain shift)? Note the score drop from <em>cartoon </em>to <em>sketch</em> domain (70% → 59%), while <a href="https://arxiv.org/abs/2003.06054">later models</a> are able to achieve <strong>75%</strong> accuracy on sketch domain with other training methods. It’s interesting to think about how the regularization’s role in generalization would evolve in the future!</p><h3>What to Read Next</h3><p>A natural follow-up for <strong>MetaReg</strong> is <strong>Feature-Critic Network</strong>, which introduces a feature-critic score for updating parameters, instead of just relying on conventional cross-entropy loss.</p><p>Happy coding!</p><p><a href="https://yutengli.medium.com/paper-review-series-domain-generalization-9ebf63673e5c">Paper Review Series— Domain Generalization</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a35d0ab2ed0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Review —  Meta-Learning for Domain Generalization (AAAI 2018)]]></title>
            <link>https://yutengli.medium.com/review-meta-learning-for-domain-generalization-aaai-2018-833867f1f6b9?source=rss-e3bdb4f4b4d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/833867f1f6b9</guid>
            <category><![CDATA[meta-learning]]></category>
            <category><![CDATA[domain-generalization]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[paper-review]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Kevin Li]]></dc:creator>
            <pubDate>Tue, 13 Apr 2021 06:27:11 GMT</pubDate>
            <atom:updated>2021-04-14T02:24:01.419Z</atom:updated>
            <content:encoded><![CDATA[<h3>Review — Meta-Learning for Domain Generalization (AAAI 2018)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9JGcAyuflR_xZHPUTIr5Mg.png" /><figcaption>Image from the Original Paper</figcaption></figure><p>More posts about Domain Generalization here.</p><p><a href="https://medium.com/@yutengli/paper-review-series-domain-generalization-9ebf63673e5c">Paper Review Series— Domain Generalization</a></p><p>Source: <a href="https://arxiv.org/pdf/1710.03463.pdf">https://arxiv.org/pdf/1710.03463.pdf</a></p><p>Meta-Learning for Domain Generalization (MLDG) model is the first meta-learning DG model published shortly after the <a href="https://arxiv.org/pdf/2011.00362.pdf">MAML</a> paper rise to star in the computer vision field. As MAML did, MLDG proposes a <strong>gradient-based model-agnostic </strong>training procedure to promote domain-invariant feature learning by the “learning to learn” strategy, with a difference in that MAML aims to provide a <strong>high-sensitivity few-shot model initialization</strong>, whereas in DG we assume <em>zero</em> shot learning for target domains. This paper evaluates their procedure in both <strong>Computer Vision </strong>and <strong>Reinforcement Learning</strong> settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kho_yfGyCK9AZO_qBvpd-A.png" /></figure><h3>Intuition</h3><p>Before MLDG, most of the DG models either do <strong>multi-domain learning </strong>(MDL), or relies on <strong>domain-alignment methods</strong>. Naive MDL already provides a strong baseline in DG problems, but an obvious problem is that the number of parameters increases as we aggregate more training domains. Domain-alignment methods, on the other hand, involve on handcrafted machine learning metric, such as minimizing MMD (maximum mean discrepancy) between all source domains, which raises a question:<strong> Instead of assigning an objective for our model, can the model <em>learn</em> its own objective flexibly</strong>? MLDG aims to guide the model to learn the domain-invariant features by simulating <strong>domain shift</strong> within every training iteration.</p><h3>Method</h3><p>MLDG deals with <strong>homogeneous </strong>DG problems, where the label space of source and target domains are identical (i.e. the model doesn’t have to learn <em>new labels</em> in the target domain as in few-shot learning).</p><p>We define <strong><em>θ</em></strong><em> </em>as the set of trainable parameters, <strong><em>S</em></strong> as source domains, and <strong><em>T </em></strong>as target domain(s). Inside <strong><em>S</em></strong>, we further divide it into <strong><em>s-v</em></strong> (meta-train) and <strong><em>v </em></strong>(meta-test) domain. Then the training procedure goes as the following for <strong>Supervised Learning</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2P-NcFMAFxMYEuuBgUuWjg.png" /></figure><p>As seen in the pseudo-code, in each iteration, we first calculate the gradient based on just the meta-train domain <strong><em>s-v</em></strong>, and then calculate the semi-updated parameters to <strong><em>θ’ </em></strong>before calculating the loss with respect to meta-test domain <strong><em>v. </em></strong>Lastly, update the parameter using the weighted sum of meta-train and meta-test gradients (<em>β</em> is a hyperparameter set to 1.0 in the supervised setting). Function <strong>F</strong> and <strong>G</strong> are the average cross-entropy loss across samples.</p><p>Note that the <strong>only</strong> place where we <em>update</em> the parameter is on line 9, the meta-objective. But does this “domain-shift simulation” actually work?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*WW_WEeOO0fANm1HsGELVJQ.png" /><figcaption>Meta-objective</figcaption></figure><p>Since <strong>F</strong> is tuned solely based on meta-train domain, the above objective can be interpreted as “<strong><em>tune such that after adjusting for one domain, performance is also good for another domain</em></strong><em>”. </em>There’s also an interpretation in the original paper, using <strong>linear approximation</strong>, to explain that the loss would decrease symmetrically (updates in the same direction) between <strong>F</strong> and <strong>G</strong>.</p><p>The training procedure for <strong>Reinforcement learning </strong>is analogous to that of supervised learning, only now our samples are <strong><em>trajectories</em></strong><em> collected by applying </em><strong><em>policy</em></strong><em> </em>𝛑 <em>on source domains</em>. Loss functions <strong>F</strong> and <strong>G </strong>are negative Reward function as in normal deep RL settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kZMZUgoxAYiiy7bElplZmQ.png" /></figure><h3>Results and Discussion</h3><p>The team evaluates their result on one multi-domain object recognition benchmark <strong>PACS</strong> (photo, art paintings, comic, sketch) and two reinforcement learning benchmark (<strong>Cart Pole</strong> and <strong>Mountain Car</strong>). Here we’ll focus the discussion on PACS only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PviyGnqtgIcA3V8JGs5Jlg.png" /><figcaption>Results on PACS</figcaption></figure><p>This paper, and many following DG papers, follows the “<strong>one held-out</strong>” rule for domain splits, where we take out <strong>1 domain as the target</strong>, and the remaining (in this case, 3 domains) as our <strong>source</strong> domains. Here Deep-all denotes multi-domain learning model, and D-MTAE stands for deep multi-task (denoising) autoencoder. As we can see MLDG performs well on average, but the improvement is marginal. Note that that on the <strong><em>sketch</em></strong><em> </em>row (the largest domain shift among PACS), MLDG leads the result of Deep-all by a solid 5%, which seems to indicate that under large domain shift, meta-learning model generalizes better. Yet, under the <strong><em>photo</em></strong> row, MLDG’s performance was moderate.</p><p>Given that it’s the first MAML-style DG model, I find the result promising, but not convincing enough that it’s better than <strong>MDL</strong>. This paper somewhat naively adopted MAML’s procedure onto DG problems, but since an ideal MAML-style model guarantees <strong>high sensitivity for fine-tuning </strong>instead of <strong>out-of-the-box accuracy</strong>, utilizing MAML with DG might require more tricks to work well (and I believe that in 2019 the<a href="https://arxiv.org/abs/1902.00113"> Episodic Training for DG</a> paper answers the confusion).</p><h4>Thought: Is “one held-out” dataset split valid for meta-learning</h4><p>In most of the meta-learning-based DG methods, datasets are split using <strong>one held-out</strong> fashion. For example, in MLDG’s <a href="https://github.com/HAHA-DL/MLDG">code</a>, one way to split PACS dataset would be domain <strong><em>P</em></strong> as the target, and domain <strong><em>A,C,S</em></strong> as the source, where domain <strong>A</strong>, <strong>C</strong>, and <strong>S</strong> then take turns to be the meta-test domain. So an example of iterations would be (A, C → S), (A, S → C), (S, C → A).</p><p>I find this training process somewhat questionable (I could be wrong though). Analogously, if we look at meta-learning in <strong>few-shot learning</strong> settings, the default training method is to <strong>sample</strong> some images for meta-train and meta-test sets respectively, <strong>WITHOUT replacement</strong>. However in DG settings, perhaps due to the lack of domains in the training set, each source domain <strong>takes turn</strong> to be meta-test domain. The fundamental difference is that if the domains take turn to be in meta-test, the model can “<strong>peek at</strong>” the domain that it’s told to generalize to during training (meta-test) after some iterations. Doesn’t that somewhat defeats the purpose of meta-training across distributions/domains ?</p><p>This is an open-ended question, and since almost all DG papers adopted this setting, it makes me nervous to challenge it. But I also can’t help wondering if there’s a better way to apply meta-training to DG ?</p><h3>What To Read Next</h3><p>MLDG opens up many inroads for meta-learning on DG problems. Since 2018, there have been regularizer-based methods like <strong>MetaReg </strong>(training a regularizer using meta-learning), feature-based methods such as <strong>Feature-Critic</strong> (assigning a “feature score” for meta-test output as an auxiliary loss, in addition to conventional cross-entropy loss), and <strong>Episodic Training</strong> (tune a domain-agnostic model with different episodes of domain-specific feature extractors and classifiers)…etc. We will be covering the aforementioned 3 models (and more) in the coming posts.</p><p>Happy coding!</p><p><a href="https://medium.com/@yutengli/paper-review-series-domain-generalization-9ebf63673e5c">Paper Review Series— Domain Generalization</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=833867f1f6b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Paper Review Series— Domain Generalization]]></title>
            <link>https://yutengli.medium.com/paper-review-series-domain-generalization-9ebf63673e5c?source=rss-e3bdb4f4b4d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ebf63673e5c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[distribution-shift]]></category>
            <category><![CDATA[paper-review]]></category>
            <category><![CDATA[domain-generalization]]></category>
            <dc:creator><![CDATA[Kevin Li]]></dc:creator>
            <pubDate>Tue, 13 Apr 2021 03:05:49 GMT</pubDate>
            <atom:updated>2021-04-20T08:24:37.502Z</atom:updated>
            <content:encoded><![CDATA[<h3>Paper Review Series— Domain Generalization Research</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wVWpKUn3kb4TcTotIQiRyw.png" /><figcaption>Source: <a href="https://unsplash.com/photos/DSQda5dqWPw"><em>Unsplash Image</em></a></figcaption></figure><p>Hey guys, this post is intended to record the papers that I’ve studied throughout my term as an undergraduate researcher at National Taiwan University, focusing on <strong>Domain Generalization in Computer Vision</strong>. I will be listing out papers that I believe are relevant, and continuously update this post with new blogpost reviews that I write. The goal isn’t just to recite these proposed models, but<strong> to promote discussions on the models’ pros and cons so as to explore potential improvement directions</strong>. Without further ado, let’s start with a gentle introduction to domain generalization.</p><h3>Topics of Papers</h3><ul><li><strong>Domain Generalization</strong>: Meta-learning methods, Data augmentation methods, Adversarial Training methods… etc.</li><li><strong>Self-supervised Learning</strong></li><li><strong>Transformers</strong> <strong>in Computer Vision</strong> (<em>to be updated</em>)</li></ul><h3>What is Domain Shift and why it matters</h3><p>Domain shift, a.k.a. distribution shift, has been a critical problem in almost every field of machine learning. An intuitive example would be the fact that an autopilot system trained on a dataset collected in New York, may perform poorly in New Delhi, since the cars might not be in the same shape, traffic congestion has gone worse…etc. Neural Networks are good at providing deterministic answers, but however precise they are, models can only be as fair as the given distribution, which is why <strong>out-of-distribution</strong> domain shift has been challenging to solve.</p><p>To address out-of-distribution domain shift, conventional <strong>training-validation dataset split</strong> paradigm is no longer sufficient since both sets are from the same distribution. One of the fields to promote the robustness of models is Domain Generalization, involving methods such as <strong>multi-domain learning</strong> (to provide diverse cross-domain cues for Neural Network to learn), <strong>meta-learning </strong>(simulate domain shift within the training procedure), <strong>data-hallucination</strong>, and <strong>adversarial training</strong> (to challenge our models’ dependence on irrelevant cues of the data by adding human-imperceptible noises) just to name a few. The end goal of<strong> DG</strong> (short for Domain Generalization) is to enable <em>a model, trained on a finite set of domains, that’s ready to use out of the box for other domains</em>.</p><p>However, most of the methods mentioned above still suffer some extent of <strong>overfitting </strong>to the <strong>source domains</strong> that the models are trained on. Recent advent of self-supervised representation learning methods may shed some light on possible alternative approaches.</p><h3>Related Topics to Domain Generalization</h3><p>The field of domain generalization actually was inspired by few-shot learning methods. There are two main types of few-shot methods that address domain shift:</p><ul><li><strong>Domain Adaptation</strong>: DA can be considered a subfield of Transfer Learning. DA models are also trained on a set of <strong><em>source</em></strong> domains, aiming to perform well on novel <strong><em>target</em></strong> domains. The difference is that some small amount of target domain labelled data is available for the model to <em>adapt</em> to.</li><li><strong>Unsupervised Domain Adaptation</strong>: UDA models are also trained on labeled data from a<em> </em><strong><em>source</em></strong><em> </em>domain to achieve better performance on data from a <strong><em>target</em></strong> domain, with access to only <em>unlabeled data</em> in the <strong><em>target</em></strong> domain.</li></ul><h3>Types of Domain Generalization Problems</h3><p>There are two main types of DG problem settings: <strong>Homogeneous</strong> and <strong>Heterogenous </strong>domain generalization. Homogeneous DG is when the <strong>label space </strong>of target domain(s) are the same as source domains. In this setting, the model could be trained on cartoons and painting of horses, and then asked to identify horse in photos.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUZhnjmk8UTgU1sl9CZkmA.png" /><figcaption>Homogeneous DG example (source: PACS dataset paper)</figcaption></figure><p><strong>Heterogeneous DG</strong> is a more challenging setting where the target domains’ label space are not different, potentially disjoint, from the source domains. A heterogenous DG model may be trained on images of<strong> traffic signs</strong>, but then asked to identify <strong>aircrafts</strong>. While the distribution mismatch is severe, this is arguably a more realistic scenario, considering the ubiquitous ImageNet pretraining paradigm. For many practical applications, when fine-tuning data is not available, a standard practice is to use an ImageNet CNN off-the-shelf as a fixed feature extractor, and then train a shallow classifier for the new problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y12ChwwQOCvMqpTHeGjwDA.png" /><figcaption>Heterogenous DG example: Visual Decathlon Benchmark</figcaption></figure><h3>What to expect in this series</h3><p>The field of DG has gain a lot of momentum in the past five years, though the performance is still far from ideal for practical applications. In this series, we will be reading papers in a topical order, starting from <strong>meta-learning based methods</strong>, <strong>data augmentation</strong> to<strong> self-supervised learning</strong> based methods. There might also be some posts about <strong>Transformers</strong> in vision problem since I believe that the attention mechanism is also a promising direction for DG research. Deep Learning is such a young field where groundbreaking findings emerge almost on a monthly basis, and domain generalization is no excpetion. I personally find it a pleasure reading about these creative solutions, so let’s start our journey!</p><h3>Catalogue of Papers</h3><p>(<em>Updated on 2021. 04.13</em>)</p><h4><strong>Good to know Prerequisites</strong></h4><ul><li><strong>Meta-learning </strong>:: <br>(MAML) Model-Agnostic Meta-Learning for Fast Adaptation of Deep Networks, ICML 2017 (Source: <a href="https://arxiv.org/abs/1703.03400">https://arxiv.org/abs/1703.03400</a>)</li><li><strong>Generative models</strong> :: AutoEncoder, VAE, and GAN</li><li><strong>Neural Network can “memorize” answers </strong>:: Understanding deep learning requires rethinking generalization, ICML 2017 (Source: <a href="https://arxiv.org/abs/1611.03530">https://arxiv.org/abs/1611.03530</a>)</li></ul><h4>Survey Paper</h4><ul><li>Domain Generalization: A Survey, arXiv 2021. (Source: <a href="https://arxiv.org/abs/2103.02503">https://arxiv.org/abs/2103.02503</a>)</li></ul><h4>Meta-Learning on DG</h4><ul><li>Learning to Generalize: Meta-Learning for Domain Generalization, AAAI 2018. (Source: <a href="https://arxiv.org/abs/1710.03463">https://arxiv.org/abs/1710.03463</a>)</li></ul><p><a href="https://yutengli.medium.com/review-meta-learning-for-domain-generalization-aaai-2018-833867f1f6b9">Review —  Meta-Learning for Domain Generalization (AAAI 2018)</a></p><ul><li>MetaReg: Towards Domain Generalization using Meta-Regularization, NeurIPS 2018. (Source: <a href="https://papers.nips.cc/paper/2018/file/647bba344396e7c8170902bcf2e15551-Paper.pdf">link to NeurIPS</a>)</li></ul><p><a href="https://yutengli.medium.com/review-metareg-neurips-2018-2a35d0ab2ed0">Review — MetaReg (NeurIPS 2018)</a></p><ul><li>Episodic Training For Domain Generalization, ICCV 2019. (Post: TBA. Source: <a href="https://arxiv.org/abs/1902.00113">https://arxiv.org/abs/1902.00113</a>)</li><li>Feature-Critic Networks for Heterogeneous Domain Generalization, ICML 2019. (Post: TBA. Source: <a href="https://arxiv.org/abs/1901.11448">https://arxiv.org/abs/1901.11448</a>)</li><li>Domain Generalization via Model-Agnostic Learning of Semantic Features, . (Post: TBA. Source: <a href="https://arxiv.org/abs/1910.13580">https://arxiv.org/abs/1910.13580</a>)</li></ul><h4>Data Augmentation on DG</h4><ul><li>Deep Domain Adversarial Image Generation for Domain Generalization, AAAI 2020. (Source: <a href="https://arxiv.org/abs/2003.06054">https://arxiv.org/abs/2003.06054</a>)</li></ul><p><a href="https://yutengli.medium.com/review-deep-domain-adversarial-image-generation-aaai-2020-8ee5eb596a4f">Review — Deep Domain-Adversarial Image Generation (AAAI 2020)</a></p><ul><li>Rethinking Domain Generalization Baselines, ICPR 2020. (Post: TBA. Source: <a href="https://arxiv.org/pdf/2101.09060.pdf">https://arxiv.org/pdf/2101.09060.pdf</a>)</li><li>Domain Generalization with MixStyle, ICLR 2021. (Post: TBA. Source: <a href="https://arxiv.org/abs/2104.02008">https://arxiv.org/abs/2104.02008</a>)</li></ul><h4>Self-Supervised Learning on DG</h4><ul><li>Domain Generalization by Solving Jigsaw Puzzles, CVPR 2019. (Post: TBA. Source: <a href="https://arxiv.org/abs/1903.06864">https://arxiv.org/abs/1903.06864</a>)</li></ul><h4><strong>Other Self-Supervised Learning methods</strong> (not specific to DG)</h4><ul><li><strong>SimCLR</strong>: A Simple Framework for Contrastive Learning of Visual Representation</li><li>Contrastive Predictive Coding (<strong>CPC</strong> v1 and v2)</li><li>Contrastive Multiview Coding (<strong>CMC</strong>)</li><li>Momentum Contrastive Learning (<strong>MoCo</strong> v1 and v2)</li><li>Bootstrap Your Own Latent (<strong>BYOL</strong>)</li><li>Simple Siamese (<strong>SimSiam</strong>)</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ebf63673e5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Course Selection Guide from Berkeley EECS Faculty Advising Session]]></title>
            <link>https://yutengli.medium.com/course-selection-guide-from-berkeley-eecs-faculty-advising-session-9170ba394bae?source=rss-e3bdb4f4b4d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/9170ba394bae</guid>
            <category><![CDATA[uc-berkeley]]></category>
            <category><![CDATA[eec]]></category>
            <category><![CDATA[course-guidance]]></category>
            <dc:creator><![CDATA[Kevin Li]]></dc:creator>
            <pubDate>Sun, 19 Apr 2020 02:03:01 GMT</pubDate>
            <atom:updated>2021-03-29T01:55:57.868Z</atom:updated>
            <content:encoded><![CDATA[<h4>Inspiration from professor’s post on CS70 Piazza</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*COgjq3-mC-GIJlUeqeBTBw.png" /><figcaption>Picture taken in my first semester at UC Berkeley. <em>August 2020.</em></figcaption></figure><p>Below is a thread on course guidance for UC Berkeley engineering students excerpted from CS70 (<em>Discrete Math and Probability</em>) Piazza, specifically for the freshmen / sophomores who are taking on Machine Learning career. This semester, I was in professor Sahai’s faculty advising session (<em>Apr. 16th, 2020</em>) and thought that this piece of info would be valuable for any Berkeley student. Thus making a post to record it.<strong> All the provided information below is from his response during the advising session.</strong></p><p><em>Dear students,</em></p><p>I had my EECS advising session, and I think based on the questions I got, there are probably a few questions that many of you have that I should just answer here for everyone.</p><blockquote><strong>1. How should you decide what courses you should take?</strong></blockquote><p>For anyone in one of our majors (EECS or LSCS), there is a very simple approach to building out schedules. First, complete the six lower-division foundational courses (the computational trilogy 61A, 61B, 61C and the modeling/math trilogy 16A, 16B, 70). Next, start simultaneously building a wide base with an element of depth in the upper-division.</p><p>Look at <a href="https://hkn.eecs.berkeley.edu/assets/course-map-2019-da79ecbe2fc25e6b6349b8931364890032b8d51aacaccea65151ae98316f0587.png">HKN’s excellent map</a>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*21Z4q7497dLAlrD2YjAriw.png" /><figcaption>Amazing resource from Berkeley HKN Society</figcaption></figure><p>This is a very good resource since it clearly calls out the actual lines of dependency among courses. Since 70 is a lower-division course, it is useful to view things from 70’s perspective.</p><p>Notice that there are two key gateway courses in the lower-division: 16B and 61C. 16B is the gateway to the entire AI/ML related zone, mathematical courses generally, as well as the “interacting with the physical world” side which includes everything from robotics on down. 61C is the gateway to the computation side which ranges from software systems to digital hardware.</p><p>Here, 70 essentially plays a supporting role for 16B — — adding a vital dose of mathematical maturity that is essential for the next level of courses. I’ll say more about that later in this post.</p><p>Back to building out your base. In general, your first upper-division courses should be from the level that is marked “core” in the HKN map. Typically, two cores from different areas. After that, you should continue with the typical pattern of one more core plus either another core, or a course that builds on the core at what HKN calls the “extension” level. At some point, you might want to get down into the more “specialty” courses.</p><p>The above strategy will build you a strong base with an area of concentration where you’ve gone deeper.</p><blockquote><strong>2. Where do you go from CS70 (Discrete Math)?</strong></blockquote><p>There are three natural successor courses to 70 itself. The most direct successor to 70 is 126. This helps you actually get to what many of us would consider the minimum level of probability understanding that you actually need. Especially after this semester where we’ve had to make some content cuts in response to the Covid-19 crisis, you really should take 126 if this last module of 70 has been good for you. (i.e.~you think you’ll be pulling a B+ or better level of understanding on the probability material.) If your understanding of the probability is weaker, then you might want to seriously consider taking Stat 140 instead since that course doesn’t have a 70 prereq and will hit some of the same content in a gentler fashion to let you catch up.</p><p>The second pair of natural successors are 127 and 170. Both of these don’t really build that much on the material in 70 per se, but do have an absolute hard dependence on the mathematical maturity that 70 builds. 127 is the most natural successor to 16B and the topic (continuous optimization) occupies an absolutely central role in the subject and is the midst of an explosive expansion of relevance. A huge amount of cutting-edge algorithmic work in a vast variety of areas is increasingly based on the 16B/127-style of thinking as compared to the more traditional 61B/170-style. In the AI/ML area, the transition is essentially complete but the same sort of thing is happening for graph algorithms, and a bunch of other areas. (For this reason, 127 (along with 126) should probably be considered a straight-up prerequisite for courses like 270 at this point.) 170 can be considered the natural successor to 61B and the diverse material there is a part of the standard vocabulary of the subject — — most people should probably take it before they graduate. Despite 127-style thinking’s modern dominance, it is good to have exposure and appreciation for diverse algorithmic perspectives that 170 brings — — the 170 perspective even helps you better leverage the 127 material. (And in particular, there is an ongoing resurgence of SAT-solving based combinatorial techniques that can be quite powerful in many modern settings — — from 151-style chip design to 164-style programming languages to 149-style embedded systems and 161-style security.)</p><blockquote><strong>3. Math is great and all, but I want to make sure I can get a job. What courses should I take?</strong></blockquote><p>This isn’t necessarily clear from the HKN map, but there are plenty of incredible courses that you can take that make you quite employable. Arguably, the single most “employable” course is 151. It is a lot of work, but teaches extremely valuable skills and it is perhaps the only <em>“one hit kill” type of OP course that we have in that it alone is enough to qualify you for a full-time position at a top employer.</em> It’s also extremely good context even for folks outside of architecture/digital-design, and can combine very usefully with other practical areas. (For example, Prof. Sophia Shao has recently taught a follow-on special topics course on thinking about hardware for ML, which is a red-hot area in industry.)</p><p>The core systems courses like 149 and 162 are also very useful — — arguably essential — — for anyone who wants to have a long term career in software engineering. Similarly, taking 105 and then 140 is very useful for anyone who might want to have a foot in analog hardware. (140 is another “get a job at Apple” type of course.)</p><p>The amazing thing about Berkeley’s flexible program is that someone who comes in as a freshman and takes 2 EECS techs per term basically can take 16 EECS courses before they graduate in 4 years: 6 lower-divs + 10 upper-divs. Someone can take all of the above: 105, 140, 149, 151, 162 and still take 5 more courses to build out a deep base in a mathematical areas (say: 120, 126, 127, 170, 189) or any other areas. With that kind of broad and deep training, the person is essentially unstoppable career-wise.</p><blockquote><strong>4. Can I take 189 (Intro to ML) after 70 (Discrete Math)?</strong></blockquote><p>No. Almost certainly not.</p><p>The reality is that to properly understand machine learning, you have to build on a base of three things: linear-algebra, optimization, and probability. EECS16AB almost set the stage for what you need in that the linear algebra base is fully built and the optimization thinking is coming into view, and you’ve seen many of the key machine learning ideas. But 16AB don’t use probability and there is a definite big gap between where 70 leaves off vis-a-vis probability and where 189 starts. That gap requires EECS 126 ideally, although Stat 140 can also do the job. On the optimization thinking side, there is a similar gap between the end of 16B and where 189 starts. That gap requires EECS 127 ideally, although some courses in IEOR could also do that job.</p><p>There is also the issue of mathematical maturity. 189 expects a mathematical/modeling maturity that students develop in courses like 126 and 127 — — and so there’s a gap there as well between where 70 leaves off and where 189 starts.</p><p>To use traditional terminology (used at other schools, less so at Berkeley). 70 is a sophomore course. 126 and 127 are junior courses. And 189 is a senior course.</p><p>The issue isn’t usually programming — — the programming in 16AB is essentially enough for 189. The issue is on the mathematical side.</p><p>So, what happens to students who try to take 189 but don’t have the right maturity and background? The best-case scenario is serious struggle and pain as they try to simultaneously learn the probability, learn the optimization thinking, learn the machine learning, while struggling with the mathematical maturity involved. Instead of just being able to learn the machine learning while simultaneously strengthening their background in probability and optimization. Unfortunately, even the best-case scenario rarely turns out well. Almost always, in the face of this level of mismatch, students end up dropping concepts and just trying to survive. This can be demoralizing as well as resulting in poor understanding overall, as well as a bad grade. Far worse is the scenario where students think that they are understanding, but actually are quite confused in pretty profound ways. The worst case is when students end up in this category but because of test-taking skills and the limitations of exam making, they manage to get lots of partial credit on exams and get a decent grade — — without actually understanding the core ML concepts at beyond the cocktail-party conversation level. This kind of “false knowledge” is a kind of ticking time bomb that is far worse than simply knowing that you don’t understand. Nobody should want to be a “<a href="https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect">Dunning-Kruger</a>” exemplar in a room, even if there are other people who are also in the same boat. (Company doesn’t make this any better.)</p><p>Between probability (126 or 140) and optimization (127 beyond 16B), which is more important for machine learning? The reality is that the operational reality of machine learning fundamentally leans on optimization and linear algebra to do the work. A solid understanding of 16B can take you pretty far, and when combined with 127, you can at least follow what is going on and think tactically — — the “how” level and some of the “why”. Meanwhile, the role of probability is more at the level of strategy as compared to tactics. Probability intuition at the level built in 126 helps you understand more of the “why” parts. So, a student with a solid understanding of 16B and 126 can walk into 189 and take it together with 127 and do alright, at the cost of having to work harder than someone who already has 127. The student with only 16B and 127 beforehand will upon walking into 189 experience conceptual challenges without the probability intuition that 126 or 140 would help provide. Things can feel like just one thing after another.</p><blockquote><strong>5. What Math upper divs should you take?</strong></blockquote><p>The Math minor list of upper divs is a great guideline. If I had to pick two, I’d say 104 (real analysis) and 113 (abstract algebra). If you liked Mod Math, etc. then 113 will be a real treat for you. Both of these courses will complement what your EECS-dept training will be providing you. Folks going to graduate school will need a 104-level of understanding of analysis for pretty much all mathy areas of EECS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sixXOv_6P6GPZPYiG0WWGQ.jpeg" /><figcaption>Wheeler Hall at UC Berkeley, where many CS courses take place.</figcaption></figure><h3><em>Follow-up questions from students:</em></h3><blockquote>Q: I heard lots of upperclassman friends leaving EECS16b to senior year but took 126/127 long before that. Does doing this make our foundation shaky if one hopes to be a ML researcher in the future?</blockquote><p>Yes. It is a very suboptimal thing to do. And it also doesn’t make sense — — because it just causes more work for them.</p><p>Why does it make your foundations shaky? Perhaps the most important reason has to do with lab. Because in the Berkeley curriculum, the main ML project experience is hosted in 16B — — that’s where the lab lets you actually experience the full ML pipeline: from the data creation apparatus to the the data collection to the fitting of a model to making decisions based on that model to having that decision-making interact with the world in real time. Courses like 189 don’t actually have projects at nearly that level of completeness. They’re toys of toys by comparison. That 16B lab/project experience is designed to give perspective so that students can both see the power of models as well as be appropriately skeptical of them — — since no model is ever exact. This allows students to better understand the point of other things.</p><p>Beyond the lab, the issue has to do with fundamental core concepts like the SVD, PCA (and approximations by subspaces), classification by hyperplanes, etc… All of the foundations are built in 16B. 127 can review these things, but it expects previous exposure so that you can understand them deeper. The control and dynamics side of 16B is also vital to setup the intuitive foundation that things like gradient descent then build upon (there’s a classic 16B HW problem that does this for least squares, etc.). Walking into upper-division courses without the right foundation forces students to have to learn from scratch from the later course’s intended review/recap of earlier material. Good reviews/recaps take a slightly different angle to provide students with a “stereo” perspective. A student without 16B is walking with one eye shut.</p><blockquote>Q: Can I take EECS126 (<em>Probability and Random Processes</em>) concurrently with CS189 <em>(Intro to ML)</em></blockquote><p>You really should take this <strong>BEFORE</strong> 189. Why before?</p><p>Look at the HKN chart. Everyone has 16B and 70. So, the question is, conditioned on having 16B and 70, what is the single most important course that a Berkeley student should have in the ML area? The answer is probably 127. What are the two most important courses? 126/140 and 127. What are the three most important courses? Hard to say exactly, but I’d vote for 126/140, 127, and 189.</p><p>Now think about your entire 4 year schedule. If you’re going to take 189, you probably should be taking 126/140 and 127 as well. So the question just becomes about order. What are the legitimate considerations? Understanding and workload. The maximum understanding is by taking 126/140 and 127 before 189. The minimum workload is by taking 126/140 and 127 before 189. Both considerations vote for the same order. For students whose probability understanding would benefit by taking 140 rather than 126, the requirement to take them before is *absolute* since you presumably want to actually understand the material in 189.</p><p>Let me continue this answer below:</p><blockquote>Q: If I impatiently hope to take CS189 one semester later, and have to take one of the 126/127 concurrently with 189, which one should I take <strong>before</strong> taking 189?</blockquote><p>Why are 126 and 127 more core for undergrads in the ML area (given that everyone knows 16B and 70)? Why do we say this when you hear something different from your friends at other schools who are clamoring to take their school’s Intro-ML class? Unless you understand the answer to this question, you cannot understand what you should do here at Berkeley and why impatience is not a good strategy. The core reason is that the ML area is very rapidly evolving, and in particular, is in the midst of a partial paradigm shift. But you just get a short window in your life to take classes as an undergrad to set the foundation for lifelong learning over decades. In that context, you want to understand the foundations better by taking 126 and 127 — — especially since both courses engage directly with ML ideas while doing so and have jupyter notebooks, etc. Since the ideas/skills there will continue to be relevant for decades while it is quite possible that many things taught in any iteration of 189 that you take will just become obsolete. If you had learned that obsolete material in a way that was grounded in 126/127, you will not be caught out when obsolescence happens — — your understanding will adapt. But if you learned the obsolete material without such grounding, you will just get holes in your understanding. As the years pass, you will be diminished. And then, despite years of experience, you’ll face the risk of being replaced by a fresh graduate at exactly the time in your life when this will hurt you the most. Most software engineers are never given the choice of proactively defending themselves against this — — you have that choice because the Berkeley curriculum is different than what they have.</p><p>Let me also stop pretending that students live in an ideal world, and address some of the tensions and stresses that you face. For example, getting started with research. We understand that students can feel torn when what’s good for their understanding, education, and long-term career seems to conflict with what’s good for their short-term career. There are at least four dimensions to an Intro-ML class: vocabulary, basic concepts, actual understanding, and computational practice. Here’s the reality: after 16AB, you already have a <strong><em>rooted</em></strong> understanding of more than 50% of all the basic concepts taught elsewhere — — even if you don’t yet know what you know. You have basic computational practice already from all the 16AB stuff, and the 16B lab is a better introduction to ML than essentially anything else out there. At this point, with 70 under your belt, you can pick up vocabulary and a few other basic concepts very easily, along with more computational practice — — especially for folks with 61B-level programming skill. There’s a ton of online resources. Just go through, say, the Stanford one quarter class that <strong>(Berkeley Alum) Andrew Ng</strong> put up on Coursera. With the 16AB+70 background you have, you will go through it like a hot knife through butter.</p><p>Here’s the kicker: how much extra work would it be to go through the entire Coursera course? *Less work* than the extra work you’d have to do if you tried to take Berkeley’s 189 (which is a much more intense beast) without the appropriate background. Then, when you take 189 after having the right background, you’ll be even more golden because you can appreciate and absorb what 189 is really trying to teach you: the underlying nature of machine learning instead of just the surface. Most people at most schools don’t even get a shot at a course like that.</p><p>With something like the Coursera videos and some computational practice under your belt, the actual understanding you have from 16AB is enough for you to start being an ML code monkey — — which is how most everyone actually starts out when they start doing research as an undergrad. Don’t screw up a precious Berkeley semester for a goal that is achievable over a month in the summer in your spare time.</p><p>You don’t have to give up actually understanding things.</p><p>That said, if you decide to take one of 126/127 concurrently with 189 and the other before, the right choice is 126 before assuming you have a solid understanding of 16B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DwePHXuTKRy_O0oV9EvQiQ.jpeg" /><figcaption>Stay Hungry, stay foolish. (Source: Unsplash)</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9170ba394bae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Observation on Software Risks and Artificial Intelligence Future]]></title>
            <link>https://medium.com/data-science/observation-on-software-risks-and-artificial-intelligence-future-473a1bd55fb9?source=rss-e3bdb4f4b4d1------2</link>
            <guid isPermaLink="false">https://medium.com/p/473a1bd55fb9</guid>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[commentary]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ethics-in-tech]]></category>
            <dc:creator><![CDATA[Kevin Li]]></dc:creator>
            <pubDate>Sat, 18 Apr 2020 11:25:59 GMT</pubDate>
            <atom:updated>2020-04-21T13:37:17.541Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Software Risks and Artificial Intelligence Future</strong></h3><h4>What we should, and should not fear in the era of Machine Learning</h4><p>Humans have been living in the most machine-dominant era ever. Before most even noticed it, they have been leaving mundane decisions to Netflix recommendation, Tesla autopilot, or a bot-written commentary on the New York Times, normally without considering the fact that these machines, coded by human, might also be prone to unintended outcomes such as censorship or fake news. While it is indeed undeniable that machine intelligence in many industries has better the majority’s life quality, a rising number of news pertaining to data privacy and AI, e.g. Cambridge Analytica scandal, or killer drones involved in regional warfare, have imparted some concerns to the public. Let’s admit: We, as the entire human species, are occasionally losing control over our information and algorithms. However, when public figures talk about AI, an overwhelming proportion simply talks about its prospects, leaving some individuals nervous about human’s over-reliance on machine decisions. These fears are understandable: people are afraid of things that they are not certain about, and even experts do not know definitely what direction AI research are eventually heading to. Among those fears, which are rational and which are plainly unnecessary?</p><p><strong>Are the Fears Valid ?</strong></p><p>If we enumerate detrimental AI applications that occur to people both in news and sci-fi movies, killer drones and AI fighting bots are often on top of the list. People fear that such entities can go beyond the inventors’ control, subsequently hazarding mankind. Though it is unfortunately true that the US military has been utilizing killer drones on missions, it is still sufficient to say that AI killer bots will remain a fantasy for many decades more. Andrew Ng, former president of the Google Brain group, has it that human has repeatedly suffered from over-expectation from AI throughout history since the 1950s, and that current research is still far from producing an almighty AI that can conquer the mankind, even after AI’s mastery on Go and Starcraft 2.</p><p>Before addressing more on the fears, it is essential to know what present AI are capable of doing. Suppose that we define an AI to be <em>good</em> if one’s performance can rival human’s. In 2016 and 2019, the victory of AlphaGo and <a href="https://deepmind.com/blog/article/alphastar-mastering-real-time-strategy-game-starcraft-ii"><strong>AlphaStar</strong></a> indicated that AI is able to “<em>make good decisions within reasonable number of steps, even when full information is not available.</em>” (e.g. traditional chess AI considers 10,000,000 moves for a step, while <a href="https://deepmind.com/blog/article/alphazero-shedding-new-light-grand-games-chess-shogi-and-go"><strong>AlphaZero</strong></a> considers 10,000). In the last decade, computers also have become extremely good at synthesizing photorealistic images, playing strategy games, and assisting diagnoses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tjOhVBei-GiP21Rh-egz7Q.png" /><figcaption>Source: DeepMind Official <a href="https://deepmind.com/blog/article/alphazero-shedding-new-light-grand-games-chess-shogi-and-go">Blogpost on AlphaZero</a>.</figcaption></figure><p>With that said, are <em>some</em> other fears valid? In my opinion, yes, but it is equally important to realize what AI <em>cannot do</em> yet. Current AI is incapable of <strong><em>generalization of tasks</em></strong>, meaning that it cannot generalize its trained model to new but similar tasks, e.g. a cat-identifying model will do poorly in identifying dogs. “Machine-learning systems can be confounded by situations they haven’t seen before,” according to MIT Technology Review.</p><p>AI is also suffering from<strong> <em>identifying causation</em></strong>. The inability to “infer” results from AI algorithms’ narrow focus on correlations instead casual relationships. “It’s as if you knew that clouds made rain likelier, but you didn’t know clouds caused rain,” says Elias Bareinboim, a researcher in Columbia University. Such cluelessness is critical when AI has to answer “what if” questions. For example, a patient dies in a clinical trial; was it the fault of the experimental medicine or something else? Such reasoning is far beyond current AI’s proficiency. While researchers have provided possible solutions such as causal Bayesian networks — an architecture that can detect which variables have the most influence on other ones, such approach still has not yet made many inroads in the AI field.</p><h3><strong>Short-Term Fear: Algorithmic Bias</strong></h3><p>The inaptitude of identifying causation can be problematic when machine are used to determine <em>fairness</em>, leading to a plausible concern of current AI — algorithmic bias. Such controversy emerges in 2016 when COMPAS, a judicial auxiliary system, was accused of being biased against black defendants. ProPublica, a news investigation group, claimed that “among defendants <em>who ultimately did not reoffend</em>, blacks were more than twice as likely as whites to be classified as medium or high risk” in terms of recidivism rate.</p><p>To understand the controversy, one has to deliberate what does it mean for a system to be “fair”? Keep in mind that COMPAS assigns scores based on more than 100 factors, including age, sex, criminal history, and notably, race is “not” included. The Washington Post reanalyzed the data collected by ProPublica on defendants assigned COMPAS scores, and discovered the following:</p><ul><li>Within each risk category, the proportion of defendants who reoffend is approximately identical regardless of race. <strong>This is the inventors’ definition of fairness.</strong></li><li>The overall recidivism rate for black defendants is higher than for whites (52% vs 39%).</li></ul><p>These two traits however, result in the following two observation:</p><ul><li>Black defendants are more likely to be classified as medium or high risk (58% vs. 33%)</li><li>Black defendants who eventually did “not” reoffend are predicted to be riskier than white defendants who did not reoffend. <strong>This is ProPublica’s criticism of the algorithm.</strong></li></ul><p>A vital realization here is that :</p><blockquote><strong>The two parties’ definition of fairness are mutually exclusive, so the disparity in outcomes are mathematically guaranteed.</strong></blockquote><p>Keep in mind that while the system does not consider race for individual decisions, the “training data” does include a comprehensive feature list, which presumably, includes race. Thus, it is likely that the real-life data fed into the system has caused the system bias. Should we simply accept the unfortunate outcome? Probably not the answer most would like to hear. However, if we manually tweak the algorithm to conditionally lower the risk prediction for blacks, we are also, by the inventors’ definition, biased against white defendants.</p><p>Another example of algorithmic bias is as the following: the US government tests find even top-performing facial recognition systems misidentify blacks at rates 5 to 10 times higher than they do whites, in 2019. The repeated occurrence of questionable machine decisions left a yet unsolved issue: Is such moral dilemma inevitable for machine decision? Given that algorithms have the potential to improve the effectiveness of consequential decisions, I believe that <em>fairness</em> should be one of the important fears which people should cope with in the near future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Rt43SwiL1Y8jhsLQuWEEA.jpeg" /><figcaption>Are machines aware of fairness issue? <a href="https://unsplash.com/photos/zbLW0FG8XU8">Image Source</a></figcaption></figure><h3><strong>Long-Term Fear: Are all AI Beneficial</strong></h3><p>Starting in 2015, Elon Musk, CEO of Tesla, has been urging for US regulations on all advanced AI researches. “AI is more dangerous than nukes,” Musk explained. “Narrow AI will result in dislocation, lost jobs and better weaponry, but that’s not species-level risks I’m talking about.” Regardless the proposed regulation’s feasibility, Musk’s remark left the AI-optimistic society in confusion, especially when Mark Zuckerberg and John Giannandrea, Google AI chief, along with many researchers refuted his assertion publicly.</p><p>However, the conversation is particularly interesting. Consider this: Elon Musk is far from a technology pessimist. He is adventurous enough to invest in all his 180 million PayPal earnings into SpaceX, Tesla, and Solar City. He is also in charge of the first ever “reusable rocket” project in the human history. Musk’s focus here is not company AIs such as Siri, but artificial <em>general </em>intelligence — some unprecedented, conscious, super-intelligent entity. While I previously stated my skepticism toward these “AI apocalypse” claims, Musk’s answer brought up a critical issue of “human control over machines.”</p><p>UC Berkeley Professor Stuart Russell, one of the most influential AI researchers ever, once stated that he believe that a beneficial AI has to be “provably aligned” to human values, and when we are talking about “general intelligence”, the ultimate question is whether we can control AI’s decisions, rather than what it can do.</p><p>The losing-control fear is actually rational. Historically speaking, the computer age invented by Alan Turing is merely 70 years ago, but we have seen machines evolving from struggling to solve tic-tac-toe, to surpassing human knowledge on the board game Go within mere 30 hours of training or even solving <a href="https://deepmind.com/blog/article/AlphaFold-Using-AI-for-scientific-discovery">human-insurmountable obstacles in biomedical research</a>. From a technical perspective, Reinforcement Learning model’s acumen to environment variables and the ability to generate training data itself on the fly is exponentially better than a newborn baby. Such a rapid learning speed of an entity is undoubtedly beyond human’s comprehension before it has been invented. Thus, it might be fair to speculate that machine intelligence will outperform human’s in perhaps a century or sooner. But, are we prepared for that?</p><p><strong>Uncertainty is good for machine decisions</strong></p><p>Sometimes people are afraid to talk profoundly about the dark side of AI because the scientific practice that we have been embracing for centuries is not designed for a beneficial technology pursuit: in statistics and machine learning you minimize a loss function that is exogenously specified; in operations research, you maximize a reward function. In many disciplines, <strong><em>the way we conceive problems is based on these arbitrary selected directions to interpret the nature in a particular, and arguably skewed lens</em></strong>. “That’s the wrong problem” said Stuart Russell in an interview in 2019.</p><p>“We need machines to be uncertain, meaning to be reasonably skeptical to human assignment, so that we won’t lose control over it after it takes off in an assigned direction.” He added, “Machines should never take an input objective as a gospel truth.”<strong> </strong>Indeed, modern AI training methodology includes human assigning a fixed objective that may actually be erroneous. Sometimes those objectives exist within us but we either don’t know how to explicate it, or we don’t know what we want for our future. If an AI blindly pursue to minimize a number without considering that its goal, the numerical optima, might not make sense in human logic, the result can derail drastically.</p><blockquote>We need machines to be uncertain, so that we won’t lose control over it after it takes off in an assigned direction.</blockquote><p>This vision is perhaps ideal though. If we actually want our machine to be uncertain, all the traditional decision processes, such as Markov decision, standard game tree search, becomes inapplicable. Furthermore, this creates a much more complicated problem because human interaction are now part of the problem in machine decision. In terms of the industry, where money dominates all factors, such humane deliberation is often beyond the cost that any enterprise is willing to dedicate in.</p><h3><strong>End Thoughts</strong></h3><p>To ensure a beneficial AI future requires patience in experimenting, and audacity in challenging some old scientific methods. Even some experts’ claims regarding beneficial AI remain ambiguous: for example, if human values are ever-evolving, how can an AI be “provably aligned” to values? Yet, my perspective holds that fears toward AI are only rational if one considers what AI can and cannot do within the coming decade. The “AI with uncertainty” claim may seems implausible at this moment, but as we progress on making our machine intelligence more “conscious” of human values, such as causations, more clues could be revealed, and perhaps an AI that accounts human interaction into decision would no longer be a fantasy.</p><p><strong>Reference</strong></p><ol><li>“IBM Researcher: Fears Over Artificial Intelligence Are Overblown.” <em>Time</em>, 12 Mar. 2016, <a href="https://time.com/4281476/ibm-artificial-intelligence-watson-2016/">https://time.com/4281476/ibm-artificial-intelligence-watson-2016/</a></li><li>“Elon Musk says all advanced AI development should be regulated, at including Tesla.” <em>TechCrunch</em>, 18 Feb. 2020, <a href="https://techcrunch.com/2020/02/18/elon-musk-says-all-advanced-ai-development-should-be-regulated-including-at-tesla/">https://techcrunch.com/2020/02/18/elon-musk-says-all-advanced-ai-development-should-be-regulated-including-at-tesla/</a></li><li>“This Artificial Intelligence Pioneer Has A Few Concerns”, <em>Wired, </em>23 May 2015, <a href="https://www.wired.com/2015/05/artificial-intelligence-pioneer-concerns/">https://www.wired.com/2015/05/artificial-intelligence-pioneer-concerns/</a></li><li>“AlphaZero: Shedding new light on chess, shogi, and Go”, <em>DeepMind</em>, 96 Dec. 2018, <a href="https://deepmind.com/blog/article/alphazero-shedding-new-light-grand-games-chess-shogi-and-go">https://deepmind.com/blog/article/alphazero-shedding-new-light-grand-games-chess-shogi-and-go</a></li><li>“Stuart Russell: The Control Problem of Super-Intelligent AI | AI Podcast Clips”, 13 Oct. 2019, <a href="https://youtu.be/bHPeGhbSVpw">https://youtu.be/bHPeGhbSVpw</a></li><li>Sam Corbett-Davies, Emma Pierson, Avi Feller and Sharad Goel. “A computer program used for bail and sentencing decisions was labeled biased against blacks. It’s actually not that clear.”, <em>The Washington Post, </em>17 Oct. 2016, <a href="https://www.washingtonpost.com/news/monkey-cage/wp/2016/10/17/can-an-algorithm-be-racist-our-analysis-is-more-cautious-than-propublicas/#comments">https://www.washingtonpost.com/news/monkey-cage/wp/2016/10/17/can-an-algorithm-be-racist-our-analysis-is-more-cautious-than-propublicas/#comments</a></li><li>Brian Bergstein, “What AI still can’t do”, <em>MIT Technology Review</em>, 19 Feb 2020, <a href="https://www.technologyreview.com/s/615189/what-ai-still-cant-do/">https://www.technologyreview.com/s/615189/what-ai-still-cant-do/</a></li><li>“The Best Algorithms Struggle to Recognize Black Faces Equally”, 22 Jul. 2019, <a href="https://www.wired.com/story/best-algorithms-struggle-recognize-black-faces-equally/">https://www.wired.com/story/best-algorithms-struggle-recognize-black-faces-equally/</a></li><li>Catherine Clifford, “Elon Musk: ‘Mark my words — A.I. is far more dangerous than nukes’”, 13 Mar. 2018, <em>CNBC</em>, <a href="https://www.cnbc.com/2018/03/13/elon-musk-at-sxsw-a-i-is-more-dangerous-than-nuclear-weapons.html">https://www.cnbc.com/2018/03/13/elon-musk-at-sxsw-a-i-is-more-dangerous-than-nuclear-weapons.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=473a1bd55fb9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/observation-on-software-risks-and-artificial-intelligence-future-473a1bd55fb9">Observation on Software Risks and Artificial Intelligence Future</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>
    </channel>
</rss>