<?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 Renaud ALLIOUX on Medium]]></title>
        <description><![CDATA[Stories by Renaud ALLIOUX on Medium]]></description>
        <link>https://medium.com/@Renaud.Allioux?source=rss-551aac7be7bd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Renaud ALLIOUX on Medium</title>
            <link>https://medium.com/@Renaud.Allioux?source=rss-551aac7be7bd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 08:14:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Renaud.Allioux/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[Why deep neural networks are not black boxes]]></title>
            <link>https://medium.com/earthcube-stories/why-deep-neural-networks-are-not-black-boxes-34333a0ba1c3?source=rss-551aac7be7bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/34333a0ba1c3</guid>
            <dc:creator><![CDATA[Renaud ALLIOUX]]></dc:creator>
            <pubDate>Tue, 23 Jul 2019 09:00:43 GMT</pubDate>
            <atom:updated>2019-07-23T09:12:02.305Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-quvvmqvATsDBnEGpwfhg.jpeg" /></figure><h3>And why you can use it for critical applications</h3><p>Consistently with any technological revolution, AI — and more particularly deep neural networks, raise questions and doubts, especially when dealing with critical applications. <br>Often considered as “black boxes” (if not black magic…) some industries struggle to consider these technologies. <br><em>Will I be able to certify it?</em> <em>How could I ensure reproducibility and explain incidents if they ever occur?</em> <em>Will customers or users be comfortable with putting security and safety in the hand of software that “designs itself?”</em>. <br>These questions are key to increase deep learning adoptions in many fields such as defense, aerospace, autonomous vehicles or even medical technologies.</p><p>In this article, we will explain why recent advances make such technologies safe and secure, and as suitable as any other, even for critical applications.</p><h3>First off, it works. It even works better than anything else!</h3><p>Before even thinking about reproducibility or certification, the first questions to answer are “Is there any alternative?”, “Do I really need deep learning?”<br>The answers are, respectively: no and yes.</p><p>Lots of other machine learning or expert system technologies work very well for simple issues, or if you have a fixed number of solutions (for example, lots of things can be achieved thanks to NLP without deep neural networks). In fact, even within the world of machine learning, the number of applications where you specifically need to use deep neural networks is very limited. <br>But for these specific kinds of problems, there is nothing remotely close in term of performances.</p><p>Image recognition is a very good example.</p><p>When AlexNet architecture, which can be considered as the first implementation of a modern Deep Neural network, came out in 2011, it beat all competition by more than 15% on Imagenet (standard image recognition challenge), and most of this competition was already based on simple neural networks and machine learning algorithms.</p><p>In 2014 DeepFace blasted the competition on human face detection challenge by 27% at 97.35%, very close to the human score of 97.5%. Since then, all winning entries in open sources challenges for image recognition have been using deep learning algorithms.</p><p>From China to South America, all universities and researchers came up with the same conclusion: the only way to achieve or beat human performances on complex image recognition tasks is to use Deep Neural Networks. The same conclusion can be found for complex reinforcement learning tasks such as playing Go or Starcraft. All serious competitors are based on Deep Neural Network architectures. <br>Today, all competing methods, such as feature engineering, decision trees or fuzzy logic, end up with inferior performances and very low generalization capabilities. Maybe we will be able to see some changes within the next 15 to 20 year, nobody can anticipate future research, but it is very unlikely that any “conventional” algorithm will beat deep neural networks in the short term.</p><h3>Tests do mean something.</h3><p>The most common criticism when dealing with Deep Learning technology is the inability for humans to “understand” the process. To “ explain it” with a simple language and compare it to a human decision.</p><p><em>Why is this neuron activated and what does it do? </em><br>Yes, this can be hard (it has been noted that it is not simpler for any complex computer vision algorithm….) but this is why testing algorithms is important. And, especially for deep neural networks, tests mean something.</p><p>A common misconception is that the training process of a deep learning algorithm is like “storing images in a library”. The algorithm will store lots of labeled scene in training and when it is tested, if the scene is close to a scene in the library, it will be able to recognize it. <strong>This is not how deep neural networks work!</strong></p><p>When you train an algorithm to detect planes on satellite images, the algorithm will not “store” the plane images, it will actually learn what a plane IS on these images. In other words, what are the key features in the picture that make this object a plane and that one not: a plane has wings, fuselage, a tail, engine, it can be of any color, and it is usually bigger than 10m and smaller than 80m, etc. Not only the network learns to detect these features, but it also learns which features are necessary, which are optional and how those features can be hierarchized.</p><p>So, back to testing, if your training base is well designed, and your testing base is representative in term of image quality and object corresponding to what your use cases will be, then testing PROVES your algorithm performances on a certain set of image characteristic — or “domain” in mathematical language.</p><p>The “trick” comes from the interpretation of this domain or from answering the question, “<em>is this image in the same domain as the testing set so I can be sure I would have the same performances in testing and prediction?</em>”.</p><p>Indeed deep learning algorithms do not use images information like humans. Noise, compression artifact or blur can trigger/un-trigger certain neuron while not having any impact on human interpretation. However, this can actually be measured. Several methods allow estimating the confidence and robustness of an algorithm with a given testing/training set (for example <em>Deep k-Nearest Neighbors: Towards Confident, Interpretable and Robust Deep Learning</em>). In other words, you can actually say “this image is in my validation domain or not” thus alerting the user that you can face a case not covered by the algorithm or where performances were not tested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*wa7wQ_7Zv0P_hmgCyL8TJQ.png" /><figcaption>Examples of output of DKNN for explicability. The process gives you the closest image in the testing or training base that allowed it to make its decision thus enabling debugging and confidence interval estimation</figcaption></figure><h3>Deep learning can be explicable</h3><p>Grief towards deep learning methodology is often about “how it decides”. We often hear the term “black box” and the fact that “even mathematicians do not grasp why and how they work”.</p><p>This misconception comes from the fact that the network “learns” and is not designed, but we actually do understand every step of the process. <br>From retro-propagation to convolution, every step and module of a deep neural network is understandable and explainable for an expert. However, due to the complexity of the learning process, it is tough to expose explanation in a language relevant for a client or a use case, in other words, “yes the cat on this smartphone image is detected here because of certain neuron activations which have been configured this way because of backpropagation… but what does it actually mean for me?”. <br>Fortunately, there are several methods to help users visualize “why” the AI decided to behave a certain way. In the case of image detection for instance, heat mat visualization (eg: Grad-CAM) allows understanding why and where the network activates on the picture and “why” it chooses to behave that way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*xRct9b_sPj1om6exdGVmIw.png" /><figcaption>Grad-Cam visualization</figcaption></figure><p>We see here that the “dog” classification is mainly focused on the head of the animal, meaning it chooses to classify it because of its jaws, eyes, ears…while the “cat” decision was done more thanks to the general shape, color, and posture of the animal.</p><p>Dozens of other tools and methodologies enable this kind of interpretation, for example, Bayesian neural networks can flag where the algorithm is “uncertain” of its choices.</p><h4>Towards standardization</h4><p>All these methods and technics allow the validation of algorithms, give confidence estimations or flag input which can create abnormal behavior. They are key to deploy efficient deep learning for critical applications and convince customers to trust the technologies.<br>In the end, it all goes back to trust. Deep learning is not different from any kind of new technology, it is up to engineers and data scientists to present the right tools for users to understand it and eventually trust it.</p><p>To achieve that, we strongly believe that the deep learning community should push toward standard protocols and software for testing, explicability and robustness evaluation and actively take part in the certification process for norms to be relevant to the technology. <br>This is why Earthcube is taking part in the working group for ISO certification of deep learning algorithms in Europe (AFNOR/CN JTC1/SC 42).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34333a0ba1c3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/earthcube-stories/why-deep-neural-networks-are-not-black-boxes-34333a0ba1c3">Why deep neural networks are not black boxes</a> was originally published in <a href="https://medium.com/earthcube-stories">Safran.AI Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use deep learning on satellite imagery — Playing with the loss function]]></title>
            <link>https://medium.com/earthcube-stories/techsecret-how-to-use-deep-learning-on-satellite-imagery-episode-1-playing-with-the-loss-8fc05c90a63a?source=rss-551aac7be7bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fc05c90a63a</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[satellite-imagery]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[loss-function]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Renaud ALLIOUX]]></dc:creator>
            <pubDate>Tue, 26 Feb 2019 13:30:07 GMT</pubDate>
            <atom:updated>2019-02-28T10:16:43.413Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to use deep learning on satellite imagery — Playing with the loss function</h3><p><em>Revealing the recipe for a product without giving out the secret ingredient can be challenging. Though at Earthcube, we believe in sharing tips and processes.</em></p><p><em>Introducing #TechSecret, an article series to dig deeper into the technical side of building our AI solution.</em></p><h3>Loss — use cases relation</h3><p>In machine learning, loss functions are computationally feasible functions which represent the cost of inaccuracy of the network, the “distance” between training images and the associated predictions. In other words, it is <strong>the function the whole training process is trying to minimize</strong>.</p><p>When training deep neural networks, the objective is to find the “best” minimum for the loss function. If this loss is well designed for the use case, these minima will get you the best performances and….</p><p>Wait a minute… You read that too?! “If the loss is well designed”? <br>What does it actually mean?</p><p>Loss functions are usually complex mathematical cost functions to be optimized in a multi-dimension space. It is usually chosen to be convex ( (imagine a giant multi-dimension bowl) when tackling simple machine learning problems (e.g. regression) but for deep learning applications, loss functions are usually neither even convex nor concave, making it even harder to understand its representation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/0*dduCYy0lyjIltAml.png" /><figcaption>Example of a loss function in 3D</figcaption></figure><p>So, how is it possible to find the best combination of the choice and design of the function in order to fit your use case? <br>In this article, we will propose several examples of how cycling between losses and modifying loss functions can serve better performances and more relevance to a specific application.</p><h3>The basics</h3><p>A good loss has to have several qualities: first it should be mathematically light to compute, usually derivable (or the derivate should at least be estimated). <br>For segmentation, object detection or classification a common loss is cross-entropy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zi1wKAAGGt1Bn6mqo2MSFw.png" /></figure><p>It leverages the logarithm scale to be fast but accurate (large loss numbers have strong slopes, but small loss numbers are flatter, allowing larger learning rates) while being computationally simple.</p><p>However, it has some drawbacks:</p><p>The first one is that it is mathematically far from the metric that is usually evaluated for object detection.</p><p>Often, one would evaluate the IoU to evaluate the capacity of algorithms to detect objects on images. The usual threshold is 0.5, meaning that you need to detect more than 50% of an object for it to count as a good detection. <br>With cross entropy, you will get the same value if you optimize 50 pixels of one object as one pixel of 50 objects — which is not what you want in the end.</p><p>Moreover, cross-entropy does not take into consideration class imbalance. <br>If you take the example of car segmentation in satellite imagery, you will obtain the same loss improvement by getting a background pixel right as by getting a car pixel right, which can give misleading scores when 99% of pixels in your image are background.</p><h3>Solving class imbalance</h3><p>A simple way to solve the class imbalance issue is to introduce the notion of <strong>weighing in your loss</strong>. If you start by calculating the ratio of pixel/object between each class, you can then use this ratio to penalize more error on the less frequent classes. Again, a good example is the weighted cross entropy.</p><p>The formula is the same as the normal cross entropy, except that it is weighted for each class with a factor:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/367/1*ivG9-3Z3EGxUCuYsej6PRg.png" /></figure><p>If we get back to the example of segmentation on an image composed of 99% background and 1% object, using weighted cross entropy, you will get 99 times more loss reduction by getting a car pixel right than by getting a background pixel right, thus <strong>maximizing the efficiency of your optimization</strong>. <br>Playing with this weight can also allow the data-scientists to go for more recall or more accuracy depending on the use case, but we will get back on that later on.</p><h3>Using object-wise loss</h3><p>In order to solve the problem of distance between loss and actual performance evaluation, a good solution is also to use object-wise loss, especially when dealing with segmentation.</p><p>Thanks to these, your neural network will optimize directly at the object level and the cross-validation metrics you will obtain will be much closer to the actual performances score. <strong>At Earthcube, we like to use Jaccard-distance loss to achieve this. </strong><br>It is a direct implementation of the “intersection over union” formula: a great loss function to get clean, regular shapes in segmentation:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*r_fwLPv3Z8xCAEiA" /><figcaption>Jaccard distance formula</figcaption></figure><p>However, these losses, as all custom losses, are harder to manipulate than simple cross entropy. There are fewer tables that can diverge easily or strongly bias results towards precision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o8BNG4vtn4bsDlblhY285Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUaMBZ3ll9ZovAMfxWxrsw.png" /><figcaption>Prediction after few Jaccard loss iteration (left) and before (right), object a better shaped but recall could decrease.</figcaption></figure><h3>Using loss as tunable hyper-parameter</h3><p>This illustration is finally adaptable to all loss implementation: some are faster to implement, some are more stable and some can prevent class imbalance or score dependencies. A great example of that is the focal loss.</p><p>First implemented for retinanet (see <a href="https://medium.com/@smallfishbigsea/notes-on-focal-loss-and-retinanet-9c614a2367c6">here</a> for details) the focal loss can be adapted to several applications and has lots of strong qualities: it copes with class imbalance and also introduces hard mining directly into the optimization process. <br>However, it can be highly unstable and it needs lots of fine-tuning to achieve good results on other architectures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*DwXYPfF3SdYdcPiG8jxDsA.png" /><figcaption>Example of a focal loss validation score. A strong instability and divergence can be observed due to an unadapted parametrization. This training was, obviously, not very successful.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/1*hDyjDtv2XBRuyAs4t6JL2Q.png" /><figcaption>Visualization of instability due to the loss parametrization (vehicle segmentation): a strong bias toward recall makes the algorithm classify large areas as false positive</figcaption></figure><p>Moreover, by choosing the right loss and parameters, you can adapt and fine-tune your algorithm to your actual performance needs: as stated, Jaccard distance tends to bias toward accuracy while a strong weighted cross-entropy can be tuned to go toward recall. <br>Consequently, for small object detections, we have developed a process to take advantage of this.</p><p>We often start training with weighted cross entropy and then bias results toward recall to force algorithms to detect the necessary features. <br>When recall numbers are satisfying, we switch toward Jaccard-distance at a small learning rate to reduce false detection rates. <br>By cycling this process, we can improve performances and adapt the algorithm to specific use cases: if it implies counting objects, we will try to get balance performances while, if the use case implies detecting a needle in a haystack, we will use cross-entropy to bias results toward less false negatives, etc….</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*lZtzMIV8bJ_5JpLsvPeYEw.png" /><figcaption>Example of Jaccard cycling. Several cycles of Jaccard loss vs cross-entropy allow to increase F1 score and adapt between recall and precision.</figcaption></figure><p><strong>Mastering loss functions really is mandatory to get the most of your deep learning algorithms. </strong><br>One needs to understand its theoretical basis as well as its applications and limitations to ensure that performances fit their clients’ needs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fc05c90a63a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/earthcube-stories/techsecret-how-to-use-deep-learning-on-satellite-imagery-episode-1-playing-with-the-loss-8fc05c90a63a">How to use deep learning on satellite imagery — Playing with the loss function</a> was originally published in <a href="https://medium.com/earthcube-stories">Safran.AI Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How not to test your deep learning algorithm ?]]></title>
            <link>https://medium.com/earthcube-stories/how-not-to-test-your-deep-learning-algorithm-c435993f873b?source=rss-551aac7be7bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/c435993f873b</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[remote-sensing]]></category>
            <category><![CDATA[satellite-imagery]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Renaud ALLIOUX]]></dc:creator>
            <pubDate>Mon, 03 Dec 2018 11:07:53 GMT</pubDate>
            <atom:updated>2018-12-03T21:36:42.519Z</atom:updated>
            <content:encoded><![CDATA[<h3>How not to test your deep learning algorithm?</h3><h4>An application to object recognition on satellite imagery</h4><p>Testing AI and deep learning neural networks performances can be a pain. When you build a deep learning application, you want to validate your performances as much as possible and fill your product spec sheet with quantitative numbers. However, quantitative testing needs a ground truth to be meaningful, and the having ground truth tends to make one wants to include that data in training to increase… performances. This is a real dilemma, especially when labeled data are scarce or expensive to get, e.g. when dealing with remote sensing images.</p><h3>What are algorithm performances?</h3><p>But before even thinking about testing data, it is important to understand what a “good” algorithm is. <br>When training an AI, a common misunderstanding is to think that you want your algorithm to learn every possible situation there is, to then be robust to everything that could happen. But this is not true. What you want when training an AI is to be able to generalize, i.e. learn the minimum feature combinations that describe the object. Mathematically, it is a combination of convolution filters weighted together in order to minimize the loss function. For face detection, for instance, an algorithm will learn that a face is round, contains ears, a mouth, a nose, eyes, and that eyes are elliptic, that they contain a round concentric black shape and another circle that can be blue/green/brown... Hence combining these features with a certain weighting would give the best loss score. This is how convolution neural networks, which are the base of AI for object recognition, actually “learn”.</p><p>In addition to learning what the algorithm is tasked to detect, it is also paramount to learn what it should not detect. If you want to detect red Ferraris, you will need to give your algorithm lots of red objects which are not Ferraris, or your algorithm will put a Ferrari tag on every red object it detects, including tomatoes or British phone booths. In order to test your algorithm performances, you will then want to give it lots of red sports cars, to be sure it is robust enough. However, by doing so, you may bias your test results. Indeed, giving too many “hard examples” will result in unrealistically poor scores. Getting your test data right is thus a big challenge: if your test base is composed of many “easy” examples, you will get overestimated performances, but if your test database is too complex, you will exhaust your resources trying to get impossible performances in production. It is nearly impossible to have a working recipe when building a testing protocol, but it is possible to give guidelines regarding what NOT to do.</p><h3>Bad idea #1: Don’t think about your metrics</h3><p>In order to test, you need metrics. Usually, these metrics are pretty standard: recall, precision, F1/F2-scores or maps are pretty common for data scientists. What is more tricky though is how you compute them to be relevant for your real-life applications. To master this, you need to think ahead about your use cases and the technology you will need to use. Indeed, even if you want to detect one unique thing, you might end up using different metrics depending on your customers’ needs.</p><p>A great illustration for that topic is car detection on satellite imagery. Imagine that you want to detect parking occupations: you could use object-based localization and detection to put boxes around cars. Metric would thus be pretty straightforward: IoU (intersection over union). One box will count one object and you could thus derive your parking occupation.</p><p>However, object-detection algorithms could struggle to detect vehicles on satellite imagery above 50cm of resolution. This is due to the fact that these algorithms, either one stage or two stages, use the concept of regions and classify these regions. But a car on a 50cm image is mainly a blurry ovoid of 10x6 pixels… way too small to be considered as a “region” by most region-based algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*AYDyE-bS8DW7Zu32ppBlbA.png" /><figcaption>This is what trucks/cars would look like on 30–50cm satellite imagery</figcaption></figure><p>Thus, an alternative could be to use segmentation, i.e. algorithms that classify every pixel of your picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*LdiIPmthqf-lV8H2VdOHIQ.png" /><figcaption>While ensuring better performances, segmentation algorithms can struggle to separate small objects.</figcaption></figure><p>This way you would have the total surface of the parking that is occupied by cars. But your object separation would thus be much harder. So how you would count your score? It’s starting to be tricky indeed…! <br>It is possible to find a solution looking at the surface occupied by the segmentation: in the end, parking space is just m². But if you were to use the same technology to actually “count” cars for a car maker production evaluation, it would be completely different, and you would need to use another metric.</p><p>Even a metric as simple as precision can be misleading. Basically, it evaluates the number of false detection rates. However, this number increases a lot when the size of the image increases. It is quite simple to understand that, for the same algorithm, you have more probability to have a false detection on a 200km² image than on a 20km². This is why, internally, we prefer to evaluate some metrics per km².</p><p>This simple example illustrates that there are infinite ways to evaluate performances depending on the objects, technology, use cases… Users and developers should be careful when looking at a number that often seems “too good to be true”. And this is just the beginning. Once you have the metric, one big question remains: which data do I need to use? Or in fact, which data should I <em>not</em> use?</p><h3>Bad idea #2: Testing on the training dataset</h3><p>Yes, “nobody is dumb enough to do that”. Indeed it is basic in machine learning to use different data in training and validation/testing. But why is it a bad idea really? The answer is actually more complex than it looks like.</p><p>Using training data to test your algorithm can result in undetected overfitting and over-specialization, which is defined as the process of an algorithm matching data without learning to generalize. Over-specialization comes from not having diverse enough training bases and overfitting comes from too much freedom in your model.</p><p>Both can be very hard to detect for deep learning as you often have millions of parameters of freedom and hundreds of thousands of data points for training. Using regularization techniques such as dropouts helps but cannot totally prevent the process. If we go back to the red Ferrari example, if your training base is only composed of black cars and red Ferraris, there is a very strong possibility that your model will over-simplify the problem: red = Ferrari, not red = not Ferrari, this is a basic example of over-specialization of your training base and rigorous testing easily allows to detect it.</p><h3>Bad idea #3: Split the same image between training and test</h3><p>If your application is detecting pedestrians for an autonomous car application, you will want to use very varied landscapes and roads. Nobody will have the idea to use one side of the images for training and the other half for testing.</p><p>Unfortunately, we still see that a lot for remote sensing applications, mainly due to the scarcity and size of the data. Satellite images can be up to 1 billion pixels, hosting tens of thousands of instances of the same object. A first POC usually leverages a very limited number of images, often one or two. Consequently, testing is often performed on subparts of the same image that is used in training, thus not accounting for weather, image quality or landscape variations, creating a huge positive bias. This also explains why you can see a huge discrepancy in performances between some research paper/POC performances and actual “real life” applications. When you learn and test on one image it is quite easy to get above 90 or 95% in F1 score, but a huge disappointment always comes when you test the same network on a different location/date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/392/1*F6igjGAoXcGMqx5peCAAeg.png" /><figcaption>Same area, same sensor but 3 weeks apart</figcaption></figure><h3>Bad idea #4: Use the same geographical scene to train and test</h3><p>This notion here is trickier to understand and could also depend on the use case. If you are performing a recurrent monitoring of the same area, it is not specifically bad to test your algorithm on this area, but if you want to build generic detectors, you will once again put a huge positive bias in your performances. It is quite easy to understand that the lack of landscape diversity in your testing base will bias the algorithm positively. However, it is also related to how Earth Observation satellites actually work.</p><p>Most of Earth Observation satellites are in sun-synchronous orbit, they always picture the same area at the same solar hour, meaning every image you get from Paris from World View 3 satellite will be at the same hour in the late morning (minus off-nadir imaging capabilities but I’m trying to keep it simple here…). So you will get similar lighting conditions, shadows and will not get all the daily variability in weather or human activities. Depending on the site, you can also encounter very different atmospheric phenomenon: haze, humidity, or aerosol: all of these impact the images quality and thus the algorithm’s ability to detect objects within the satellite images. We found a huge variation in image quality and thus algorithm performances (up to 30%!) between sites taken at the same local hour at the same resolution due to this factor, so it is needed to evaluate performances on sites both in training and not in training to see if performances are consistent and homogeneous.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*SvP4LLMiAeYetoUFdbnBTA.png" /><figcaption>Example of various landscapes and geographies that are changing drastically algorithm results</figcaption></figure><h3>Last bad idea: Use the same sensor in train and test</h3><p>This also depends on your use case, but you will usually want to take advantage of every sensor available to get more image frequencies. Even at the same resolution, sensors have different physical qualities that can change image aspects, spectral responses or color balances. We have even seen algorithm performances variations between two sister satellites Pleiade 1A and Pleiade 1B: when trained only on P1A, our object detection algorithm had much lower performances on P1B. Consequently, we now test performances on the whole sensor catalog we own, from QuickBird 2 to Worldview 4, panchro and multi-spectral. It is also important in order to understand where to specialize. For example, we realized that you can use the same algorithm for boat detection between 30cm and 1m resolution but you would need 3 vehicle detection algorithms if using the same resolution range. Only a balanced test base can show you this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*HOlenSD8xEIwFwZCXGgdDg.png" /><figcaption>Sensor and image qualities can have a tremendous impact on object aspects</figcaption></figure><h3>In the end, what are good performances?</h3><p>For marketing or demonstration applications, it is always easy to show 90–95, sometimes even 97% precision/recall. Even with a limited number of training and test examples, it is easy to (voluntary or not) over-fit your remote sensing application to be very good on one specific image, location, and time. However, problems appear when scaling up and it is always related to human performances. This is why it can take months or years of research to get above 90% F1 score for object detection in satellite imagery. And sometimes these scores are not even reachable.</p><p>On the 1st of October, we reached a milestone at Earthcube: we had officially labeled more than 1 million vehicles alone for training deep learning algorithms on satellite images. So we decided to perform a benchmark on the ground truth quality with several military-trained photo analysts. Results were not a surprise if you look back at what a vehicle looks like on a satellite image: when labeling the same full-size images we saw the variability going from 10% on “perfect” 30cm multi-spectral clean images, to more than 25% for more difficult images (panchro only, high off-nadir angle…). Of course, this decreases the quality of the dataset and thus, of the detection rate. If it is hard for the human, it is also hard for the algorithm and, in the end, an AI cannot be better than the dataset it was trained on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mZ_9t3nUO9MOnTxqLFLQqQ.png" /><figcaption>There are more than 37k vehicles on this image. It is impossible for a human to label it with 95% accuracy without spending 4 weeks on it.</figcaption></figure><p>The same conclusion was drawn when we discussed automatic pipeline surveillance. When you actually look at human performances, one can miss up to 30% of the threats during an aerial flyby due to a decrease of attention caused by long flight times, the speed of the aerial vector, or observation conditions.</p><p>In the end, when you get 70 or 75% F1 score, which can be considered a bad score on paper, you could be, in fact, above human-level performances on many use cases and image types.</p><p>When you ask customers, they always want “&gt;90%” but it also the job of the data science team to explain what is actually achievable and what good performances are compared to what a human can achieve. It is then critical to be able to show that test methodology ensures and confirms the reliability and robustness of the solution and, above all, fits the client’s use case.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c435993f873b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/earthcube-stories/how-not-to-test-your-deep-learning-algorithm-c435993f873b">How not to test your deep learning algorithm ?</a> was originally published in <a href="https://medium.com/earthcube-stories">Safran.AI Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How hard is it for an AI to detect ships on satellite images?]]></title>
            <link>https://medium.com/earthcube-stories/how-hard-it-is-for-an-ai-to-detect-ships-on-satellite-images-7265e34aadf0?source=rss-551aac7be7bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7265e34aadf0</guid>
            <category><![CDATA[satellite-imagery]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[remote-sensing]]></category>
            <dc:creator><![CDATA[Renaud ALLIOUX]]></dc:creator>
            <pubDate>Wed, 12 Sep 2018 12:54:33 GMT</pubDate>
            <atom:updated>2018-09-27T16:20:26.096Z</atom:updated>
            <content:encoded><![CDATA[<h4>Using hard mining and multires ensembling to unlock 95% recall</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*F-4iLviNtTJisk3KMlFQDQ.png" /><figcaption>It looks like an adversarial example Captain!</figcaption></figure><h4>Asking for the moon during summer break</h4><p>At Earthcube, our job is mainly to monitor sensitive sites at a very large scale. We take dozens, potentially hundreds, of sites and use AI and satellite imagery to track strong and weak signals for security, defense, and financial markets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ubLZpN2PskCR1Y6Ku242TQ.png" /><figcaption>Earthcube AI powered dashboard for airbase monitoring in Iran</figcaption></figure><p>We are able to detect vehicles, aircraft, ships, temporary constructions, infrastructures and various changes. We use semi-specialized detectors and post processing to reach the best performances and usually target above 90% F1 score on limited and controlled specific areas.</p><p>At the end of June, one of our clients asked for a generic ship detector on 30–80cm satellite imagery with very good performances (above 95% recall). It had to work on 8–16bit imagery, panchro or RGB, from any location in the world, without any specification on the sensor except resolution. Of course they needed it in less than 2 months and, to add to the difficulty, it was during the traditional “french summer break” when most (normal) people flee from Paris to more breathable areas.</p><p>Basically we had to solve ship detection on very high resolution satellite imagery in less than 50 working days.</p><p>From an external point of view, seeing Kaggle competition results or marketing announcements, it seemed simple. In the end, boats always have the same shape, the sea is always the sea… how complicated could it be?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BybWklt3t0M8zdSXtkipRg.png" /><figcaption>Just tankers on the sea. Nothing hard to detect? (copyright Digital Globe imagery)</figcaption></figure><p>I wished it were that simple. To appreciate the complexity of the task, anyone can download the (wonderfull) Iarpa-Fmow dataset for free and randomly look at port images. You would find pictures with very variable qualities and resolutions, with scenes including iceberg, haze, de-pointing, weird boat shapes, sun glint, over or underexposure, compression artifact etc…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BaTzw5NQ8wUH4NJmwAU-ag.png" /><figcaption>Example of image diversity on Iarpa Fmow database (copyright Digital Globe)</figcaption></figure><p>A generic boat detector has to work on all of these (and more!).</p><h4>Our approach</h4><p>We were seeing several difficulties on this project.</p><ul><li>First, the timing was very short and we only had limited resources available</li><li>Our database was only built for specialized detectors in segmentation and was not diverse enough for such a task</li><li>Image diversity is close to infinite, so we had to emphasize on testing to ensure reliable performances</li><li>Lots of studies are available but only few show good results and even fewer are tested on a database large enough to ensure that an industrial application is even possible.</li></ul><p>Fortunately we have developed a very powerful framework to iterate fast and efficiently.</p><p>The first task was to separate training and labeling in three batches to iterate on different architectures as fast as we can and select best candidates.</p><p>We then tested both instance segmentation and object detection in parallel with ~20 different models, each model with several sets of hyper-parameters while increasing the database at the same time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zy0eoDBhX7Z1QzQPiaIBog.png" /><figcaption>Process we ran during the 2 months of the project. It took roughly 30 days to reach the final model. The last 20 days were used for fine tuning and final training.</figcaption></figure><h4>Labeling only what’s needed</h4><p>The data labeling part was done using images from 30cm to 80cm on more than 15 different geographical areas. The production team worked closely with the data science team all along the project to deliver batches of new data corresponding to training iterations. We built a first dataset of 40k ships leveraging our already labeled database. We used it to train on the first 20 models. As ships are quite simple to identify on satellite imagery, we then leveraged our &gt;500 000 km² VHR images database to visually test, at each iteration, dozens of full size images of harbors and shipyards. We used basic “Hard Example Mining” to grow iteratively the training dataset: we selected the images on which the detections were visually the worst and sent them for manual labeling. This is a simple but very efficient process to increase the performances of your model and reduce annotation and training times. Thanks to our labeling platform and outsourcing partners we now have close to 10k labels/day capabilities in segmentation (we label everything at pixel level for flexibility), so the process only took a few days.</p><p>We also kept several full size images of locations out of the training base to generate a testing set for final performances evaluation. This is really critical for earth observation imagery. You often see testing on the same geographic scene as the training, meaning often the same lighting, weather or landscape parameters (EO satellite are sun synchronous, so they always get above the same area at the same solar local time). If you want a generic detector, it has to work on scenes going from Canada to Australia, from 10am to 4pm, in winter and summer and even if the location is not in the training database.</p><h4>Leveraging multi-resolution</h4><p>We started testing proprietary instance segmentation and object detection models with numerous variations (number of layers, architectures etc…) and hyper parameters (loss, patch sizes, pre-post processing, optimizer). We generated automatic test reports after training on our test database with IoU &gt;0.5 metric.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9IzOm3_2dN1q6n1V7DdpIg.png" /><figcaption>Exemple of spreedsheet generated by our testing process</figcaption></figure><p>After two iterations, we only focused on object detection as instance segmentation was not significantly delivering better results and needed more resources.</p><p>After several trainings we ended up with a single model we tried to fine tune to meet the client’s need.</p><ul><li>&gt;95% recall on ship bigger than 15m</li><li>no real-time needed</li><li>&gt;85% F1 score</li></ul><p>The problem was that on 30 to 80cm imagery, the ships’ size varies from 15 to 400m. Consequently, for larger ships on higher-resolution images, larger image patches are needed to preserve enough context. We tried to push entry patch size up to 2048px. However, at this size, we needed to reduce the batch size down to …1. Even on P100 GPUs, the benefits of using batch-norm layers was lost because of the inadequate batch size. A solution could be to down-sample images to lower resolution: At a resolution of 90cm, a patch of 1024 pixels contains far enough context to accommodate larger ship while allowing the use of batch normalization with reasonable sample sizes. Although with this technique, we ended up losing lots of recall on smaller vessels (&lt;50m). At this point, we were stuck at around 80% F1 score and 90% recall, which was below requirements.</p><p>Our dataset already contained 30 to 80cm imagery, so using 1024 pixel wide patches at native resolution leveraged the benefits of batch norm without losing too much context, and we did not witness much performance gains by playing with up/down-sampling images during training. Nevertheless, this trick was used during inference: by taking a multi-resolution ensembling approach in prediction, we managed to get more context for large ships while retaining details for small ones. Our algorithm uses up to ten different resolutions (up or downsampled) for the same image to get a final prediction mask.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*LIXHle36qz-ueqtC5wo0lA.png" /><figcaption>Example of Multires inference. Performances are ensured on large and small ships alike (Copyright digital globe imagery)</figcaption></figure><p>Final results are pretty satisfying. We pushed recall a lot due to the customer’s requirements so we had a few false alarms but this was easily solved using basic sea masking (false alarms were mainly on buildings or large trucks.)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*WQDq5LzsWnaCqoXbTVeIng.png" /><figcaption>Exemple of false detection: shadow, dirt and lower image resolution confused our algorithm. (Copyright digital globe imagery)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*F6u5rfv9Fx_4mQRZHppGyw.png" /><figcaption>Final performances tested on 780km² in total of shipyards and harbors (with location not present in the training base) representing 1021 ships to be detected in 4 continents.</figcaption></figure><p>Improvement could still be made using oriented bbox (see Yang et al 2018 <a href="https://arxiv.org/abs/1806.04331">here</a>) and native multires training in order to reach better F1 score without sea masking, but these are complex developments. However we managed to pull out state-of-the-art boats detection in very agile cycle and very short timeline.</p><h4>So, is AI that simple?</h4><p>No, it is definitely not.</p><p>If you are not familiar with geographic data, accessing relevant images alone and setting up good labeling standard could take months. Developing a flexible training framework , standardized test practices and scalable infra require state of the art knowledge in machine learning, data engineering and software development. Even more importantly, there is no “magic trick” to solve every problem, but tools to be standardized for data-scientists to use. The same multires approach was tested in different observables and use cases and we ended up with even poorer results than the simple resolution approach.</p><p>To be honest most of large and small companies in this field still struggle to reach the maturity to be able to deploy and maintain industrial applications.</p><p>The key for us is to be able to test, on very short time-frames, dozens of different new models, hyperparameteres and tricks, with standard testing procedures and easy-to-use tools. With this approach our team can gain a lot of experience at a very high pace. However, it requires a very good machine learning framework, solid data and software infrastructures and very fast labeling capabilities.</p><p>AI is not simple, in fact it is a very hard field of work, especially when you are using remote sensing Data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/1*WSld5TXZ2JOvpVIVyZKH_A.png" /><figcaption>And…a nice “tip of the iceberg” diagram to finish this wonderful post</figcaption></figure><p><em>If you are interested in how infrastructures can unlock AI applications’ full potential, feel free to join our “AI in production” </em><a href="https://www.meetup.com/Paris-AI-in-production/"><em>meetings</em></a><em> in Paris.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7265e34aadf0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/earthcube-stories/how-hard-it-is-for-an-ai-to-detect-ships-on-satellite-images-7265e34aadf0">How hard is it for an AI to detect ships on satellite images?</a> was originally published in <a href="https://medium.com/earthcube-stories">Safran.AI Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI products and remote sensing: yes, it is hard and yes, you need a good infra.]]></title>
            <link>https://medium.com/earthcube-stories/ai-products-and-remote-sensing-yes-it-is-hard-and-yes-you-need-a-good-infra-4b5d6cf822f1?source=rss-551aac7be7bd------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b5d6cf822f1</guid>
            <category><![CDATA[remote-sensing]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[satellite-imagery]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Renaud ALLIOUX]]></dc:creator>
            <pubDate>Tue, 24 Jul 2018 07:42:40 GMT</pubDate>
            <atom:updated>2018-09-28T16:29:49.545Z</atom:updated>
            <content:encoded><![CDATA[<h4>By the way, data scientists are also developers!</h4><p>I have recently read several blog posts explaining how “data scientists are not developers”. Well, at least at Earthcube, they are. Of course building an AI product does not require the same skills and IT knowledge as developing a web app, but this is true for every developer job. Embedded software development is not the same job as front end development for a mobile app, which itself is a different job from implementing a back end on AWS for an IOT company.</p><p>The common denominator of all these jobs is the fact that, in a startup, you are able to leverage the agility and speed of the team to iterate very fast on your developments and tests. And to do that correctly, you will need to implement tools, infra and automatic processes to ensure standardization, reproducibility and quality.</p><h3>The need for agile cycles</h3><p>What is common to data science products and other development jobs is this need and ability to iterate fast and to follow a cycle, regardless if you are training a new model or developing a new architecture. Of course, this cycle is specific to data science, as mobile app development has its own dev cycle.</p><p>This how we formalize it at Earthcube:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/447/1*hcPRSBAuS7AX7Q9w0LfvtA.png" /></figure><p>Each part needs to be backed by an infra and each integration has to be as automated as possible! This is also critical for the efficiency of your R&amp;D. <br>A scalable and efficient infra can give you a significant technological heads up.</p><h3>Back to the point</h3><p>Building AI products based on satellite data is hard. It mainly comes from the scarcity, complexity and diversity of images, but also from the different problems that need solving.</p><p>Image labeling might be one of the most important steps of the cycle. As discussed in my previous post, satellite images are hard to deal with. They are heavy, expensive, do not include weak labeling and they need skills to be leveraged. Moreover, due to their nature, satellite images can involve confidentiality issues. They are also very variable in terms of resolution and quality, and the diversity of object of interest is tremendous. Hence, labeling must be done very carefully.</p><p>You will obviously want to have a clear knowledge of these assets at anytime: how many images you have, how many objects are labeled. It is also critical to be able to track the time needed for each labeling. Consequently, you will want this data to be ingested in your system as soon as possible in order to keep control over every parameter before and during labeling. You will also need a strong database to be able to reference this labeling and link it to the proper images. You do not want to get your data out of your system for labeling, whether you are using external or internal resources to do so. Eventually, you will need a strong quality control. Image interpretation is hard and requires skills and knowledge. While labeling millions of objects, you need to ensure that the quality remains as high as possible</p><p>This is why at Earthcube we chose to build our own labeling platform, based on PostGis database, using GeoJson format and GIS standard. Designed and coded in less than 90 days, we are now able to perform labeling directly within our infrastructure, with no data coming out of our server at any time. Every action is tracked and logged and KPIs are generated live. Internally, we are able to access images and their related labels in real time, adjust the task if the quality decreases or even correct the process if instructions are unclear. This whole infra eases the pain a lot. Anytime, anywhere, I can connect to our data lake, track our progresses and anticipate data-related issues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GhwhYb4LInG8notNYRd9TQ.png" /><figcaption>Earthcube labelling platform (copyright Digital Globe imagery)</figcaption></figure><p>Back into the data science cycle : once images are labeled, you will need to develop new models or adapt the existing ones to your framework, prepare your options and set up your experiments. In order to do so, we built our own keras-based AI library that allows the quick deployment of new architectures with very few developments needed. Thus, we can innovate in short cycles, test new ideas and implementations, and increase our R&amp;D efficiency.</p><p>Before training, datasets are built and made available to the data scientists via an API and Yaml interfaces. No original data is pulled on training machines, datasets are generated on servers, based on image databases and queries from the data scientists.</p><p>How does it help and why this is important?</p><ul><li>First, at anytime, when an image is labeled, it is directly made available to the data scientists : no files exchange is needed and all queries are standardized and tracked.</li><li>Datasets can be built based on PostGis geographical queries, allowing to test several configurations. Then, if I want every labeled images containing cars and boats in Ukraine for instance, I can obtain it with a simple API call.</li><li>Finally it ensures traceability: all dataset generations are logged and saved so that I can retrieve the exact parameters I used to create a given dataset, even six month after.</li></ul><p>It all seems pretty straightforward but it is absolutely paramount when labeling millions of objects on thousands of satellite images, especially if you want to shorten your dev cycles. Without versioning and tracking, your company datasets will turn into a giant pile of unusable bloat within months.</p><h3>Black magic</h3><p>Once you have your dataset, you will need to use it to answer your questions and train your model. But first, you have to choose your hyperparameters.</p><p>For instance, regarding object detection, you can have three approaches for the architecture alone before even starting your development:</p><ul><li>Segmentation: efficient on small objects but harder to separate and could necessitate more images to train</li><li>Object detection : efficient on large objects but can struggle to detect/separate small targets. It is also harder to train</li><li>Instance segmentation: can combine the advantages of segmentation and object detection but it is not easy neither to implement nor train</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z5gEy1oK-jFKrDqwUOXpUA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eujZmZSG4RxfLcOHFjlTSA.png" /><figcaption>MaskRcnn with oriented BBox and Retinanet results for boat detection.</figcaption></figure><p>Also, each approach can be used with several models, methodologies and hyper-parameters. We had long philosophical discussions with the team in order to find the best approach for each problem, but to be honest the truth really is ‘‘it depends’’. And this is actually true for most things in deep learning… Should I use Adam? SGD? What kind of data augmentation works better? Is a Unet preferable to a Segnet? The only definitive answer I can give is “it depends”.</p><p>For example, we chose to use segmentation for car detection as it offers much better performances. They were achieved switching between Cross-entropy and custom Jacquard loss mid training with various radiometric augmentations and a highly customized architecture. However on some other tasks, we found that nothing worked better than an off-the-shelf Unet with a “simple” binary cross-entropy launch for 300 epoch.</p><p>On the other hand, regarding boat detection, segmentation gives poor results and MaskRccn and object detection both work very well. Oddly, using hard example mining with object detection increases performances significantly but did not add much on instance segmentation. And this is just the beginning. Literature is moving so fast that there are no definitive answers. We are testing — as we speak, a modified Retinanet approach that could move some of our detection algorithms out of segmentation. This is why data scientists also need to be researchers: they need to be able to tweak parameters before and during trainings, continuously read papers, implement new architectures and generally speaking test new stuffs as often as possible.</p><p>From an outsider point of view it may seem a bit overwhelming. Some might say that the technology is not mature. But if you take a step back it is totally natural. With the hype, AI has been seen as a “black magic” solution to solve every data-related problem. It is not. AI is a set of frameworks and toolboxes one can use to automatize various complex or repetitive tasks.</p><p>What we found is that, when dealing with monitoring from Space, it is needed to automatize hundreds of different tasks using dozens of different data types. Most of the time, “off the shelf” solutions were not delivering strong enough performances, so we had to develop problem-specific architectures and training strategies. This ‘specialization’ increases with the performance requirements (the famous “no free lunch theorem!”). Detecting fighters on 30cm satellite imagery in the desert landscape will probably not use the same network as detecting bombers on 1m resolution images in Russia if you target &gt;90% F1 score. However, to iterate fast on this customization you need a very strong framework to train, test and productize your algorithm.</p><p>My first job was at Airbus, working on Jupiter Icy Moon Explorer mission. Obviously, there was no unique definitive answer for every problem as we were trying to build a spacecraft to explore the biggest planet of the solar system. But there were processes, frameworks and tools.</p><h3>Test, test and let others decide</h3><p>To cope with the complexity of remote sensing AI-based product, you need to develop a toolbox including three things:</p><ul><li>A good dev framework to ensure the fast development of specialized deep learning solutions with complete reproducibility.</li><li>The ability to test these architectures on large quantities and parameters to be sure to obtain suitable models in pre-production</li><li>The ability to deploy these models in production with a business-oriented view on the test results</li></ul><p>From research to production, you need to have the smallest cycles possible.</p><p>To do that, we pushed the framework philosophy we developed for data generation towards code design, test and iteration. When a new model is trained and seems ok for the data scientist, it is then pushed in “pre-prod” where it is tested on various datasets. Performances are automatically stored in our cloud. All training parameters, datasets and the different steps of the training are versioned so that nothing can be lost on the way.</p><p>The next part is critical. From prototype to production there is often a “gap” which very often resides in the reliability of the algorithm. And most of the time, it ends in the amount of tests performed. However, testing AI can be expensive, especially with big models and &gt;1Gpix satellites images. You may need expensive and precious GPU to achieve a reasonable testing time. Thanks to Intel MKL DNN library, we implemented a way to leverage cheaper CPU machines within a reasonable computing timeframe, thus giving us the ability to test dozens of models in parallel painlessly.</p><p>Finally, when the best models are pre-selected, putting them in production is as simple as a click: our GIS team has a web interface with all the tests results, so they just have to select the best one for the best usage or simply relaunch some additional tests if needed. Yes you read it well. It is our GIS team which selects which model to use.</p><p>Why? Because it is the team which is actually getting the clients’ problems solved. They are the ones familiar with GeoInt issues, having looked at hundreds of satellites images. Most importantly, they studied the area we are putting the algorithm in production on. They know the sensors that are the most available on each site, what weather conditions and observables are more present, the image qualities to be expected and when and where previous algorithms performed poorly . They have the ability to interpret test results depending on test data. So they get to decide which model goes in prod on which site. Having a framework that allows non-expert people to deploy AI tools is really a game changer in term of industrialisation.</p><p>However, in the end, we always go back to the data: after pre-prod tests, if the results are not satisfying, we leverage a slightly modified version of our labelling platform to correct some masks, we put the new data back in training and improve our model rapidly through continuous learning. <br>We can say we make AI as a “software”:</p><blockquote><strong>Label-dev-train-test repeat</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b5d6cf822f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/earthcube-stories/ai-products-and-remote-sensing-yes-it-is-hard-and-yes-you-need-a-good-infra-4b5d6cf822f1">AI products and remote sensing: yes, it is hard and yes, you need a good infra.</a> was originally published in <a href="https://medium.com/earthcube-stories">Safran.AI Stories</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>