<?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 calincan mircea on Medium]]></title>
        <description><![CDATA[Stories by calincan mircea on Medium]]></description>
        <link>https://medium.com/@calincan2000?source=rss-e8c6cd41e2a9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wpMTHnmR450DnZGj.</url>
            <title>Stories by calincan mircea on Medium</title>
            <link>https://medium.com/@calincan2000?source=rss-e8c6cd41e2a9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 17:00:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@calincan2000/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[The Revolutionary Impact of Crew AI in the Market]]></title>
            <link>https://medium.com/@calincan2000/the-revolutionary-impact-of-crew-ai-in-the-market-b51a167e7d74?source=rss-e8c6cd41e2a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b51a167e7d74</guid>
            <dc:creator><![CDATA[calincan mircea]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 15:59:18 GMT</pubDate>
            <atom:updated>2025-04-15T15:59:18.335Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction</strong></p><p>In recent years, the Crew AI use case has emerged as a game-changer within the tech landscape, particularly in the domains of finance, retail, and healthcare. With the AI agent industry’s valuation projected to explode from 5.1𝑏𝑖𝑙𝑙𝑖𝑜𝑛 𝑖𝑛2024∗∗𝑡𝑜 𝑎𝑛𝑎𝑠𝑡𝑜𝑢𝑛𝑑𝑖𝑛𝑔∗∗ 47.1 billion by 2030, investors, analysts, and businesses must take note of these transformative developments.</p><p><strong>Crew AI Market Growth</strong></p><p>The rapid advancements in Crew AI highlight a substantial shift in how technology can be utilized to enhance business operations and improve customer interactions. Companies harnessing these technologies are not only staying competitive but also setting new benchmarks for efficiency and innovation. Understanding the implications of Crew AI is essential for anyone looking to navigate the evolving market landscape effectively.</p><p><strong>Market Trends</strong></p><p>The 2024 market analysis reveals a pronounced shift towards AI-driven solutions that streamline various functions — from stock analysis to optimizing shelf arrangements in retail environments. As companies leverage Crew AI technology, they not only enhance efficiency but also elevate the customer experience.</p><p><strong>Automation of Financial Tasks: </strong>AI agents are increasingly utilized in stock analysis and financial planning, providing in-depth insights tailored to investor needs. By automating these processes, businesses can allocate resources more strategically and make informed decisions with greater speed.</p><p><strong>Optimizing Retail Performance: </strong>The integration of AI in retail allows companies to improve inventory management, paving the way for a more personalized customer interaction. With data-driven insights, retailers can now anticipate customer preferences and tailor offerings accordingly.</p><p><strong>AI in Retail</strong></p><p>This transformation is not simply about technology but involves adopting new methodologies that prioritize data utilization for strategic decision-making. Companies must remain vigilant and adaptable to capitalize on these emerging trends.</p><p>Opportunities and Recommendations</p><p>The Crew AI landscape teems with opportunities that could reshape entire industries:</p><p>Innovation and Efficiency: Embrace AI to automate mundane tasks and focus human talent on creative problem-solving. Businesses implementing AI are witnessing significant jumps in productivity, allowing employees to engage in more valuable, idea-generating tasks.</p><p>Personalized Customer Engagement: Leverage AI’s capabilities to curate personalized experiences that cater to specific customer needs. This engagement fosters loyalty and trust, which are invaluable in today’s competitive markets.</p><p><strong>Recommended Actions:</strong></p><p>Invest in robust AI platforms to lay the groundwork for future advancements.</p><p>Develop innovative strategies to mitigate the risks of job displacement and data privacy concerns.</p><p>Encourage training programs to build a workforce adept at working alongside AI technologies.</p><p>By executing these recommendations, organizations can not only enhance their operational capabilities but also reinforce their commitment to ethical considerations in technology adoption.</p><p><strong>Risks to Consider</strong></p><p>As with any emerging technology, the Crew AI ecosystem comes with its risks:</p><p>Job Displacement: The ascendance of AI could lead to redundancy in certain job sectors, emphasizing the need for retraining. Companies must prepare for this shift and actively seek strategies that promote workforce adaptability.</p><p>Data Privacy: Companies must implement stringent data protection measures to safeguard sensitive information. As the utilization of AI grows, the responsibility to protect data becomes ever more critical to maintain consumer trust.</p><p><strong>Risk Analysis</strong></p><p>These elements pose real challenges that organizations must comprehensively address to harness the benefits of Crew AI while minimizing unintended consequences.</p><p><strong>Conclusion</strong></p><p>The Crew AI use case represents a significant evolution in technology and business strategy, promising not only growth but also challenges that require careful consideration. By addressing the inherent risks and fostering a culture of continuous learning, businesses can harness the full potential of AI and drive sustainable growth.</p><p>In this transformative era, it is imperative that organizations not only adopt AI technology but also engage in an ongoing dialogue about its implications. The roadmap ahead is fraught with both opportunity and responsibility, paving the way for a future where AI and human talent coexist and thrive.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b51a167e7d74" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding ETL and Big Data Analytics: A Comprehensive Overview]]></title>
            <link>https://medium.com/@calincan2000/understanding-etl-and-big-data-analytics-a-comprehensive-overview-30ef1ee4be01?source=rss-e8c6cd41e2a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/30ef1ee4be01</guid>
            <dc:creator><![CDATA[calincan mircea]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 14:16:32 GMT</pubDate>
            <atom:updated>2025-04-15T14:16:32.129Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction to ETL<br></strong>In today’s data-driven world, organizations are inundated with vast amounts of information. Extract, Transform, Load (ETL) processes help businesses manage this data more effectively. ETL involves three critical steps:</p><p><strong>Extract: </strong>Data is retrieved from various sources (databases, APIs, etc.).<br><strong>Transform:</strong> This step involves cleaning and converting the data into a suitable format for analysis.<br><strong>Load:</strong> Finally, the prepared data is loaded into a data warehouse for visualization and reporting.</p><p>By understanding the ETL process, businesses can streamline their data management and ensure that the data they analyze is accurate and actionable. An efficient ETL system not only allows for better data handling but also provides insights that can drive strategic decisions.</p><p><strong>The Rise of Zero-ETL Solutions</strong></p><p>Recently, significant advancements have been made in ETL approaches. Companies like Amazon and Google have introduced zero-ETL solutions that minimize the need to transfer data between systems.</p><p>For example, Amazon’s integration with Amazon Redshift allows for near real-time analytics without the burdensome data migrations typical of traditional ETL processes. Similarly, Google’s BigQuery now enables querying Bigtable data without the need to move or copy it, streamlining operations for businesses.</p><p><strong>ETL Process</strong></p><p>This shift towards zero-ETL solutions is transforming how organizations view data architecture. With minimal lag in data processing, businesses can make faster decisions and react more swiftly to market changes.</p><p><strong>Big Data Analytics: The Future of Insights</strong><br>Big data analytics refers to the complex process of examining large and varied data sets — often referred to as “big data” — to uncover hidden patterns, correlations, and insights. As the data landscape evolves, so too do the strategies for analyzing it.</p><p><strong>Trends Reshaping Big Data Analytics</strong><br><strong>Cloud-Based Solutions: </strong>Many organizations are now opting for cloud platforms that offer flexibility and scalability. This trend is critical as it allows businesses to adjust their data management strategies according to demand.</p><p><strong>Machine Learning and AI</strong>: Implementing machine learning and artificial intelligence tools within ETL processes can significantly enhance efficiency and accuracy, fostering more data-driven insights.</p><p><strong>Data Mesh Concept: </strong>Emerging as a solution to scalability issues, the data mesh approach emphasizes decentralized data management, allowing teams to independently manage their data products.</p><p>These trends indicate the evolving nature of big data analytics and underscore the need for companies to stay abreast of technological advancements. Adopting modern strategies can lead to substantial competitive advantages.</p><p><strong>Industry Insights</strong><br>The global big data analytics market is projected to grow from USD 189.77 billion in 2023 to USD 417.67 billion by 2032, demonstrating a CAGR of 13.5%. This growth is attributed to the increasing demand for real-time analytics and data-driven decision-making across various sectors, including healthcare, finance, and retail.</p><p><strong>Big Data Market Growth</strong></p><p>As the market expands, organizations that effectively capitalize on these trends will likely lead their industries. Understanding the nuances of big data analytics is fundamental to navigating this landscape successfully.</p><p><strong>Implications for Businesses</strong><br><strong>Invest in ETL Solutions:</strong> Companies should explore adopting cloud-based ETL solutions to harness the benefits of scalability and flexibility.</p><p><strong>Embrace AI and ML:</strong> Integrating AI and machine learning into data workflows is essential for improving operational efficiency.</p><p><strong>Consider a Data Mesh Approach:</strong> Embracing the data mesh concept can help organizations manage data more effectively at scale.</p><p><strong>Stay Updated: </strong>Regularly updating ETL strategies and adopting the latest technologies is crucial for maintaining a competitive edge in the market.</p><p>These strategies are not merely recommendations; they are essential steps businesses must take to thrive in an increasingly data-centric environment. By investing in advanced technologies and innovative practices, organizations can ensure that they remain at the forefront of their industries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=30ef1ee4be01" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Uso de la IA para predecir sequías, inundaciones y desplazamientos de conflictos en Somalia]]></title>
            <link>https://medium.com/@calincan2000/uso-ia-para-predecir-sequias-inundaciones-y-desplazamientos-de-conflictos-en-somalia-5ce943dc4290?source=rss-e8c6cd41e2a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ce943dc4290</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[español]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[inteligencia-artificial]]></category>
            <dc:creator><![CDATA[calincan mircea]]></dc:creator>
            <pubDate>Wed, 27 Nov 2019 09:01:01 GMT</pubDate>
            <atom:updated>2019-11-27T09:01:01.994Z</atom:updated>
            <content:encoded><![CDATA[<figure><a href="https://chatbotchocolate.com/?utm_source=pc-post&amp;utm_medium=B-top&amp;utm_campaign=general&amp;utm_term=id0050"><img alt="" src="https://cdn-images-1.medium.com/max/680/1*lB6KDoqrcbd_XSVLxIxIpw.png" /></a></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pa4kAgz10S8vyWnMMB7AIg.png" /></figure><p>Construyendo una red neuronal que predice el Índice semanal de salud de la vegetación de Somalia con una pérdida de validación de 0.030 y una pérdida de entrenamiento de 0.005.</p><figure><a href="https://chatbotchocolate.com/?utm_source=Pc-post&amp;utm_medium=B-medio&amp;utm_campaign=general&amp;utm_term=id0051"><img alt="" src="https://cdn-images-1.medium.com/max/680/1*lB6KDoqrcbd_XSVLxIxIpw.png" /></a></figure><h3>El problema a resolver</h3><p><em>Millones de personas se ven obligadas a abandonar su pueblo o comunidad actual debido a la escasez de recursos y los desastres naturales, como sequías e inundaciones. Nuestro socio de desafío, ACNUR, brinda asistencia y protección a aquellos que son desplazados por la fuerza dentro de Somalia.</em></p><p>El objetivo de este desafío era crear una solución que cuantifique la influencia de las anomalías climáticas en el desplazamiento forzado y / o los conflictos violentos a través del análisis de imágenes recogidas a través de satelitales. La atención se centró en construir modelos que ayudarían a comprender el desplazamiento forzado, utilizando imágenes de los satelitales que retraten anomalías climáticas / cambios en el medio ambiente o su interrelación con conflictos violentos.</p><p><em>Si hay una forma en que el conflicto se correlaciona con el desplazamiento, ¿cuál es el plazo observado en el tiempo? ¿Hay un plazo entre los incidentes de conflicto y el desplazamiento observado? ¿O entre el establecimiento de asentamientos desplazados y la degradación ambiental?</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*A5sSG_MpLKNp8BdB5dUvog.png" /></figure><h3>FOG (hechos, opiniones y fase de adivinanzas)</h3><p><strong>La tarea más desafiante</strong> para este desafío fue descubrir cuáles eran los datos reales en los que confiar y cómo encontrarlos.</p><p>El equipo de innovación del ACNUR proporcionó el conjunto de datos de desplazamiento, que contiene:</p><p><em>Fin de mes, Año, Semana, Región actual (Llegada), Distrito actual (Llegada), Región anterior (Salida), Distrito anterior (Salida), Motivo, Necesidad actual (Llegada), Número de personas. Estos desplazamientos internos se registran semanalmente desde 2016.</em></p><p>Mientras buscaba cómo extraer los datos, aprendí sobre NDVI (Índice de vegetación de diferencia normalizada) y NDWI (Índice de agua de diferencia normalizada). Nuestro enfoque fue encontrar una manera de aplicar NDVI y NDWI en imágenes de los satelitales;</p><p><em>Landsat (EarthExplorer) y MODIS, Hidrología (por ejemplo, niveles de ríos, descarga de ríos, una indicación de inundaciones / sequías), Asentamiento / refugios GEO (portal GEO). Estas imágenes tienen 13 bandas y ocupan alrededor de 1 GB por imagen.</em></p><p>Además, <a href="https://www.nesdis.noaa.gov/content/imagery-and-data?utm_source=Social%20Media&amp;utm_medium=Twitter&amp;utm_campaign=FullDiskFriday"><strong>el Servicio Nacional de Satélites Ambientales, Datos e Información</strong></a><strong> ( </strong><a href="http://www.nesdis.noaa.gov/"><strong>NESDIS</strong></a><strong> ) y la Administración Nacional Oceánica y Atmosférica ( </strong><a href="http://www.noaa.gov/"><strong><em>NOAA</em></strong></a><strong> )</strong> ofrecen datos muy interesantes como las pantallas de impresión de Somalia Vegetation Health tomadas de <a href="https://www.star.nesdis.noaa.gov/smcd/emb/vci/VH/vh_imageloop.php">STAR — Global Vegetation Health Products</a> .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QoqdF_NMw6ZSTlJTqeiA8w.png" /></figure><p><strong>Al</strong> observar los puntos de la imagen anterior, me di cuenta de que el Índice de salud de la vegetación podría estar teniendo una correlación con los desplazamientos de personas …</p><p>Encontré un cuadro interesante, que llamó mi atención,</p><ol><li>Ve a la <a href="https://www.star.nesdis.noaa.gov/smcd/emb/vci/VH/vh_browseByCountry.php">página web</a> de STAR .</li><li>Haz clic en Tipo de datos y selecciona qué tipo de datos quieres.</li><li>Mira la siguiente imagen.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*62H4-UIDhXEKTghkTmsxDw.png" /></figure><p>4. Haz clic en la región de interés y sigue los pasos que aparecen a continuación.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TdzfXFww3e6KDNrlMMMnxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*duAq1MWFgyhs_Ex614bA8A.png" /></figure><p>La página web de STAR proporciona SMN, SMT, VCI, TCI, índice semanal de VHI desde 1984 dividido en provincias.</p><p><em>SMN = NDVI medio provincial con ruido reducido<br> SMT = Brillo medio provincial Temperatura con ruido reducido<br> VCI = Índice de cond. De vegetación (VCI &lt;40 indica estrés por humedad; VCI&gt; 60: condición favorable)<br> TCI = Índice de condición térmica (TCI &lt;40 indica estrés térmico; TCI&gt; 60: condición favorable)<br> VHI = Índice de salud de la vegetación (VHI &lt;40 indica estrés de la vegetación; VHI&gt; 60: condición favorable))</em></p><p><strong>Vegetación de sequía</strong></p><p><em>VHI &lt;15 indica sequía de intensidad severa a excepcional</em></p><p><em>VHI &lt; 35 indica sequía de intensidad moderada a excepcional</em></p><p><em>VHI&gt; 65 indica buen estado de vegetación</em></p><p><em>VHI&gt; 85 indica muy buen estado de vegetación</em></p><p>Para llevar los hallazgos al siguiente nivel, se deben responder las siguientes preguntas.</p><h3>Si el conflicto se correlaciona con el desplazamiento, ¿cuál es el espacio observado en el tiempo? ¿Existe un desfase entre los incidentes de conflicto y el desplazamiento observado o entre el establecimiento de asentamientos desplazados y la degradación ambiental?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M-chKwzkyTeQ-3P4wbqR4g.png" /></figure><p>Correlación entre los valores del índice de salud de la vegetación de Shabeellaha Hoose y el número de individuos registrados debido a conflictos / inseguridad.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YRClJxKzHAozNI-DtKme6Q.png" /></figure><p>Correlación entre el número de individuos de desplazamientos de Hiiraan causados ​​por inundaciones y datos de VHI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ex8HMVNnb657vRaAyfs6sw.png" /></figure><p>Correlación entre el número de individuos de los desplazamientos de suelos causados ​​por la sequía.</p><h3>Construyendo la red neuronal</h3><p>Una red neuronal que predice el VHI semanal de Somalia mediante el uso de datos históricos como se describe anteriormente. Lo puedes encontrar <a href="https://github.com/calincan2000/Omdena-UNHCR-Challenge">aquí</a> .</p><p>El modelo produce una pérdida de validación de 0.030 y una pérdida de entrenamiento de 0.005. A continuación, se muestra la predicción de la red neuronal utilizando datos de prueba.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*1aD35jw5FDBNqeufEoMFKA.png" /></figure><h3>Ser parte de este desafío de la IA</h3><p>Lo más importante es que sepas que el producto final se utilizará para salvar la vida de las personas, ¿qué puede ser más motivador que eso?</p><p>Al participar en la comunidad global de Omdena, aprendí sobre imágenes captados por satelitales y sobre cómo mejorar los conjuntos de datos mediante la creación de imágenes falsas con GANS en un tiempo récord de dos meses.</p><p>Una metáfora para los aspirantes a ingenieros de ML.</p><p><em>Aprender que los manzanos producen una mezcla de grandes frutas y lombrices. Sin embargo, las manzanas en los supermercados de alta gama exhiben fruta 100% perfecta. Entre el huerto y la tienda de comestibles, alguien pasa mucho tiempo quitando las manzanas podridas o echando un poco de cera sobre las recuperables. Como ingeniero de ML, pasarás una gran cantidad de tiempo arrojando malos ejemplos y limpiando los rescatables. Incluso unas pocas “manzanas podridas” pueden estropear un gran conjunto de datos </em><a href="https://developers.google.com/machine-learning/crash-course/ml-intro"><em>.</em></a></p><h3>Si deseas convertirte en un colaborador de Omdena y unirte a uno de nuestros desafíos de AI for Good, <a href="https://omdena.com/our-projects/">solicitalo</a> aquí .</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Ff%2F68bc97%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2F68bc97%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/d8021540cbf50434828deb5439e1cf04/href">https://medium.com/media/d8021540cbf50434828deb5439e1cf04/href</a></iframe><figure><a href="https://chatbotchocolate.com/?utm_source=Pc-post&amp;utm_medium=B-pie&amp;utm_campaign=general&amp;utm_term=id0052"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Axmr4bMScpjBU_WcOm263A.png" /></a></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/788/1*u6pz8xzjblHCXLMQUQGF3Q.gif" /></figure><figure><a href="https://twitter.com/PlanetaChatbot"><img alt="" src="https://cdn-images-1.medium.com/max/788/1*qQxzn3vV9Xu4lYMpuc5OOw.png" /></a></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ce943dc4290" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using AI to Predict Droughts, Floods and Conflict Displacements in Somalia]]></title>
            <link>https://medium.com/omdena/using-ai-to-predict-droughts-floods-and-conflict-displacements-in-somalia-40cba6200f3c?source=rss-e8c6cd41e2a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/40cba6200f3c</guid>
            <category><![CDATA[climate-change]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[satellite-technology]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[calincan mircea]]></dc:creator>
            <pubDate>Thu, 07 Nov 2019 13:27:35 GMT</pubDate>
            <atom:updated>2020-01-08T22:42:37.415Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7p_eb9mcCjpkXkxgvUVl4Q.png" /><figcaption>Forced displacement in Somalia affects millions of people</figcaption></figure><h4>A neural network that predicts and compares the weekly Vegetation Health Index with the number of forced displacements.</h4><h4>The problem to be solved</h4><blockquote>Millions of people are forced to leave their current area of residence or community due to resource shortage and natural disasters such as droughts, floods. Our challenge partner, UNHCR, provides assistance and protection for those who are forcibly displaced inside Somalia.</blockquote><p>The goal of this challenge was to create a solution that quantifies the influence of climate anomalies on forced displacement and/or violent conflict through satellite imagery analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*A5sSG_MpLKNp8BdB5dUvog.png" /></figure><h3>Facts Opinions and Guesses Phase</h3><p><strong>The most challenging task</strong> for this challenge was to find out what and where is the real data to rely on.</p><p>The UNHCR Innovation team provided the displacement dataset, which contains:</p><blockquote>Month End, Year Week, Current (Arrival) Region, Current (Arrival) District, Previous (Departure) Region, Previous (Departure) District, Reason, Current (Arrival) Priority Need, Number of Individuals. These internal displacements are weekly recorded since 2016.</blockquote><p>While searching for how to extract the data I learned about NDVI (Normalized difference vegetation index), and NDWI (Normalized Difference Water Index).</p><p>Our focus was on finding a way to apply NDVI and NDWI on satellite imagery:</p><blockquote>Landsat (EarthExplorer) and MODIS, Hydrology (e.g. river levels, river discharge, an indication of floods/drought), Settlement/shelters GEO (GEO portal). These images have 13 bands and take up around 1GB of storage space per image.</blockquote><p>Also, <a href="https://www.nesdis.noaa.gov/content/imagery-and-data?utm_source=Social%20Media&amp;utm_medium=Twitter&amp;utm_campaign=FullDiskFriday"><strong>the National Environmental Satellite, Data, and Information Servic</strong></a><strong>e (</strong><a href="http://www.nesdis.noaa.gov/"><strong>NESDIS</strong></a><strong>) and National Oceanic and Atmospheric Administration (</strong><a href="http://www.noaa.gov/"><strong><em>NOAA</em></strong></a><strong>) </strong>offer very interesting data like Somalia Vegetation Health print screens taken from <a href="https://www.star.nesdis.noaa.gov/smcd/emb/vci/VH/vh_imageloop.php">STAR — Global Vegetation Health Products</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QoqdF_NMw6ZSTlJTqeiA8w.png" /></figure><p>By looking at the above picture points I figured that the Vegetation Health Index could be having a correlation with people displacements…</p><p>I found an interesting chart, which captured my attention,</p><ol><li>Go to STAR’s <a href="https://www.star.nesdis.noaa.gov/smcd/emb/vci/VH/vh_browseByCountry.php">web page</a>.</li><li>Click on Data type and select which kind of data you want</li><li>Check the following image</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*B8qp1FR5WdAYfHPO" /></figure><p>4. Click on the region of interest and follow the steps below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TdzfXFww3e6KDNrlMMMnxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bCnMyce8AXihTTDCqdst6Q.png" /><figcaption>VHI index’s weekly since 1984</figcaption></figure><p>STAR’s web page provides SMN, SMT, VCI, TCI, VHI index’s weekly since 1984 split in provinces.</p><blockquote>SMN= Provincial mean NDVI with noise reduced<br>SMT=Provincial mean brightness Temperature with noice reduced<br>VCI = Vegetation cond index ( VCI &lt;40 indicates moisture stress; VCI &gt;60: favorable condition)<br>TCI= thermal condition Index (TCI &lt;40 indicates thermal stress; TCI &gt;60: favorable condition)<br>VHI =vegetation Health Index (VHI &lt;40 indicates vegetation stress; VHI &gt;60: favorable condition))</blockquote><p><strong>Drought vegetation</strong></p><blockquote>VHI&lt;15 indicates drought from severe-to-exceptional intensity</blockquote><blockquote>VHI&lt;35 indicates drought from moderate-to-exceptional intensity</blockquote><blockquote>VHI&gt;65 indicates good vegetation condition</blockquote><blockquote>VHI&gt;85 indicates very good vegetation condition</blockquote><p>In order to take the findings to the next level, the following questions have to be answered.</p><h4><strong>If conflict correlates to displacement, then what is the observed lag in time? Is there a lag between conflict incidents and observed displacement or between the establishment of displaced settlements and environmental degradation?</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4wkjLXDfZiQN7al08xMfZw.png" /></figure><p>Correlation between Vegetation Health Index values of Shabeellaha Hoose and the number of individuals registered due to Conflict/Insecurity.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YRClJxKzHAozNI-DtKme6Q.png" /></figure><p>Correlation between the Number of Individuals from Hiiraan Displacements caused by flood and VHI data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ex8HMVNnb657vRaAyfs6sw.png" /></figure><p>Correlation between the Number of Individuals from Sool Displacements caused by drought.</p><h3>Building the neural network</h3><p>A neural network that predicts the weekly VHI of Somalia by using historical data as described above. You can find it <a href="https://github.com/calincan2000/Omdena-UNHCR-Challenge">here</a>.</p><p>The model produces a validation loss of 0.030 and training loss of 0.005, Below is the prediction of the neural network using test data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*1aD35jw5FDBNqeufEoMFKA.png" /><figcaption>Prediction versus the original value</figcaption></figure><h3>Being part of this AI challenge</h3><p>The most important is that you know that the final product will be used to save people&#39;s lives, what can be more motivating than that?</p><p>By engaging in Omdena’s global community, I learned about satellite imagery and about enhancing datasets by creating fake images with GANS in a record time of two months.</p><p>A metaphor for aspiring ML engineers.</p><blockquote>Learning that Apple trees produce some mixture of great fruit and wormy messes. Yet the apples in high-end grocery stores display 100% perfect fruit. Between orchard and grocery, someone spends significant time removing the bad apples or throwing a little wax on the salvageable ones. As an ML engineer, you’ll spend enormous amounts of your time tossing out bad examples and cleaning up the salvageable ones. Even a few “bad apples” can spoil a large data set<a href="https://developers.google.com/machine-learning/crash-course/ml-intro">.</a></blockquote><h4>Want to become an Omdena Collaborator and join one of our tough AI for Good challenges, <a href="https://omdena.com/our-projects/">apply here</a>.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*VBXUa7YxWTZc-SnC.png" /><figcaption>www.omdena.com</figcaption></figure><p>If you want to receive updates on our AI Challenges, get expert interviews, and practical tips to boost your AI skills, <a href="http://eepurl.com/gto7Xn?source=post_page---------------------------">subscribe</a> to our monthly newsletter.</p><p>We are also on <a href="https://www.linkedin.com/company/14052175?source=post_page---------------------------">LinkedIn</a>, <a href="https://www.instagram.com/omdenaglobal/">Instagram</a>, <a href="https://web.facebook.com/OmdenaAI/?source=post_page---------------------------">Facebook</a>, and <a href="https://twitter.com/OmdenaAI?source=post_page---------------------------">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40cba6200f3c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/omdena/using-ai-to-predict-droughts-floods-and-conflict-displacements-in-somalia-40cba6200f3c">Using AI to Predict Droughts, Floods and Conflict Displacements in Somalia</a> was originally published in <a href="https://medium.com/omdena">Omdena</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#Federated Learning]]></title>
            <link>https://medium.com/secure-and-private-ai-writing-challenge/federated-learning-b9d05b53fa1b?source=rss-e8c6cd41e2a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9d05b53fa1b</guid>
            <category><![CDATA[federated-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[calincan mircea]]></dc:creator>
            <pubDate>Tue, 30 Jul 2019 20:43:27 GMT</pubDate>
            <atom:updated>2019-08-01T15:27:13.890Z</atom:updated>
            <content:encoded><![CDATA[<p>part of :</p><p>#60daysofudacity</p><h3><a href="https://eu.udacity.com/facebook-AI-scholarship?source=post_page---------------------------">Secure and Private AI Scholarship Challenge from Facebook</a></h3><p>The most widely deployed techniques in the context of private deep learning. The term was coined at Google a few years ago by Brenda McMann, and Google has been pioneering this field ever since.</p><p>Federated Learning is a technique for training machine learning models on data to which we do not have access, instead of bringing all the data into one machines in the Cloud, and training a model,we’re going to bring that model to the data, train it locally wherever the data lives and merely upload model updates to a central server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*ebOLugvFMHHb5heAgTgZ8A.png" /></figure><p>There are several use cases here we’re Federated Learning is quite interesting, but the first and probably most famous use case is in the context of mobile phones. If you’re familiar with smart phones, when you open your texting app, and the texting app tries to predict the next word that you’re about to text,the machine learning model that actually does that,if you have an iPhone or Android,it’s actually trained using Federated Learning. Meaning when you go home at night and you plug in your phone and attach it to Wi-Fi, every once in a while, it’ll actually do a bit of local training on your device, on your own text messages, and it will send a new model, a slightly smarter model up to the Cloud and then later you’ll get an updated aggregation of everyone else’s model that also went up to the Cloud,thus giving you a smarter model.Due to this you are able to benefit from having this texting model inside your phone despite the fact that you personally are not generating enough training data for it to become intelligent. So you’re benefiting from this model becoming smart by looking at thousands and millions of other phones, without any of these people having to divulge the private information&#39;s contained in their phone, and without you having to divulge any private information within your phone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*6ErVtR4PR4nqvjLdCtyu8Q.png" /></figure><p>In the context of Federated Learning, there are also other applications that are very interesting, one interesting case is predictive maintenance ,for example, if you own a car Every several 1,000 miles you have to take it in to get an oil change, We just have this fixed number of miles that we have to do this typically. But Federated Learning could be used to try to predict when your car needs to go into maintenance ahead of time by having a model that actually lives within all cars that are on the road, studying when they actually start to break down, using various aspects of your climate, how you drive, the kind of engine you have, these kinds of predictive models could actually become intelligent in doing this. The nice thing is that, this wouldn’t actually require you to upload any data from your car to some sort of central server. In theory, a model just comes down to your car, it learns how to predict when your car is going to require maintenance and it uploads that ability to predict. An update to the model, backup to the Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*Nfri4CKeiUJ635oU_-UCzQ.png" /></figure><p>Another interesting use cases is in wearable medical devices, you can imagine if you have one of those sort of fancy watches, or wristbands that’s tracking your movement, heart rate, or perhaps even your sleep cycles or if you maybe you log your diet online, one of these dialogue apps, you can imagine that Federated Learning will allow you to learn a machine learning model which could help you optimize certain parts of your health, whether it’s your diet for having a better sleep cycle, or how much you move during the day for accomplishing some sort of wake up. Again, the nice thing here is that you by yourself are not actually generating enough training data to be able to train a model like this. But, if you collaboratively trained as single machine learning model with thousands or millions of other people, then everyone can benefit from this machine learning model without anyone having to upload their data to a central Cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/664/1*ZFhORsc_XUOoXyF80ON8Vw.png" /></figure><p>Finally, one of the other widely deployed use cases of Federated Learning is inside of mobile browsers, often in the context of ad blocking or an auto-complete. That means when you go up to your browser and you start to type some website and it tries to predict what website it thinks you’re trying to refer to, again, that’s another example where Federated Learning has been used out in the world to allow large groups of individuals to enjoy the benefits of ML models without having to upload all of their data to the Cloud.</p><p>The general challenge is that you have a scenario where a dataset is distributed amongst a large number of sources, usually because it’s being produced by the sources, in the context of phone’s, browser, wearable medical devices,or automobiles, for example, what we want to do is, we want be able to train a machine learning model on that dataset. But you aren’t able to aggregate that data set for a variety of reasons. Sometimes it’s for privacy, right? There might be a legal restriction that prevents you from aggregating the data to a central server, medical data for example has a lot of these kinds of legal restrictions. There might be user discomfort. So in the case of this ad blocker or autocomplete use case within browsers, people don’t really want to upload every webpage URL that they’re going to to some central server if they don’t need to. Then of course, there are competitive dynamics.So if you think in the context that predictive maintenance, automobile companies might not want to upload to some central server every time one of their automobiles breaks down.Now, if it’s just within one brand, maybe just Ford or something like that, that’d be great. But if you can imagine that if Toyota could see when Honda cars break down because if some central server, there could be some strange competitive dynamics or leaks of potentially negative information. But Federated Learning isn’t just about privacy. Often it’s used because of engineering constraints. As it turns out, Federated Learning can actually be used to reduce the bandwidth cost of having to upload datasets to the Cloud by allowing training to happen locally inside of these devices.</p><p>So, this is why the contexts of Federated Learning is an incredibly powerful tool. It’s already been widely deployed to some very substantial use cases, and it’s one of the things that’s really advancing the fastest in terms of privacy, preserving technologies.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9d05b53fa1b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/secure-and-private-ai-writing-challenge/federated-learning-b9d05b53fa1b">#Federated Learning</a> was originally published in <a href="https://medium.com/secure-and-private-ai-writing-challenge">Secure and Private AI Writing Challenge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#Introducing Local and Global Differential Privacy]]></title>
            <link>https://medium.com/secure-and-private-ai-writing-challenge/introducing-local-and-global-differential-privacy-7ae9edea57c9?source=rss-e8c6cd41e2a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ae9edea57c9</guid>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[calincan mircea]]></dc:creator>
            <pubDate>Thu, 18 Jul 2019 01:22:37 GMT</pubDate>
            <atom:updated>2019-07-22T20:46:28.158Z</atom:updated>
            <content:encoded><![CDATA[<h3>#Introducing Local and Global Differential Privacy #Lesson 5</h3><p><strong>#60daysofudacity</strong></p><p>part of :</p><h3><a href="https://eu.udacity.com/facebook-AI-scholarship">Secure and Private AI Scholarship Challenge from Facebook</a></h3><h3><a href="https://eu.udacity.com/course/secure-and-private-ai--ud185">Secure and Private AI by Facebook Artificial Intelligence</a></h3><p>In this lesson, we’re going to get into the mid of developing differentially private algorithms.</p><p>The main strategy that we’re going to take to protect individual’s privacy is one of noise, meaning we’re going to add random noise to the database and to the queries in the database in order to protect people’s privacy.</p><p>Now, there are two different kinds of differential privacy, which refer to the two different places that you can add noise:</p><p>Local differential privacy adds noise to each individual data point. You can think of this as adding noise directly to the database or even having individuals add noise to their own data, before even putting it into the database. In this setting, users are most protected as they do not have to trust the database owner to use their data responsibly.</p><p>Global differential privacy, which adds noise to the output of the query on the database. This means that the database itself contains all of the private information and that it’s only the interface to the data which adds the noise necessary to protect each individual’s privacy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/761/0*1QvUEXQAZxWeNjyB" /></figure><p>What is the real difference between local and global differential privacy? If the database operator is trustworthy, the only difference is that global differential privacy leads to more accurate results with the same level of privacy protection.</p><p>However, this requires database owner to be trustworthy. Namely, that the database owner should add noise properly. In differential privacy literature, the database owner is called a trusted curator.</p><p>#Making A Function Differentially Private</p><p>Local differential privacy is where given a collection of individuals, each individual adds noise to their data before sending it to the statistical database itself =&gt; the protection is happening at a local level.</p><p>The question is, how much noise should we add?</p><p>First off, we saw in previous lessons the basic sum query is not differentially private.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/0*ylmr771CCk-u8xvB" /></figure><p>Differential privacy always requires a form of randomness or noise added to the query to protect from things like a differencing attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/812/0*fCRi9uYVJ-esV7uq" /></figure><p>Randomized response is this really amazing technique that is used in the social sciences when trying to learn about the high-level trends for some taboo behavior.</p><p>If you imagine that you are perhaps a sociologist and you want to be able to study how many people in a city have committed a certain crime, perhaps you’re going to study jaywalking. You sat down with 1,000 people and you wanted to ask each individual one hey, trust me, I’m not going to tell anyone on you. Have you ever jaywalked, perhaps in the last week? Well, there’s this trouble that people are going to be reluctant to divulge this information because it’s technically a crime in many locations. The sociologist are worried that the results are going to be skewed because some subset of population is going to answer dishonestly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/0*58yIR_UzYr4cRgL2" /></figure><p>Thanks to this amazing technique where in a certain degree of randomness can be added to the process such that each individual is protected with what’s called plausible deniability.</p><p>Eg: instead of directly asking each person the question, the first thing that a sociologist will do is present the question and then say, I need for you to flip a coin two times without me seeing it and if the first coin flip is a heads, I want you to answer my yes or no question honestly. Did you jaywalk? But if the first coin flip is a tails, then I want you to answer this question according to the second coin flip.” =&gt; the idea here is that half the time, individuals are going to be answering honestly. The other half the time, they’re going to answer randomly with a 50–50 chance of saying yes or no.The interesting thing here is that if a person says, “Yes, I have jaywalked in the last week,” that person has a certain degree of plausible deniability (deny if he feels that he don’t want to share openly his answer)that they’re only answering it because of the coin flip.</p><p>So they have this natural level of protection, this localized differential privacy. They have this randomness applied to their specific data point that is local to them and that’s what in theory is able to give them the protection that gives them the freedom to answer honestly and to provide more accurate statistics at the end of the day. Perhaps the most extraordinary thing is that over the aggregate, over the entire population, the individual performing the study can then remove this random noise because as you can imagine, this process is that it takes the true statistic and averages it with a 50–50 coin flip. So in this particular case, let’s say that 70 % of people actually jaywalk, like in the real world. Then we know that when we perform our survey,60 %t of our results will answer yes. Let’s take this slowly. Since 70 % of people actually jaywalk,this means that roughly half our participants will say yes or no with a 50 % probability and the other will say yes or no with a 70 % probability. Thus when we average these two together, the results of our survey will be 60 %. This is incredible. This means that we can take the result of our noise statistic and back into the true distribution, the true result. We can say since 60 % of people reported that they jaywalk, then we know that the true answer is actually centered around 70 % and we can do all of this without actually knowing whether any individual person jaywalks. Pretty incredible. Now one thing we have to acknowledge here is that the added privacy comes at the cost of accuracy. Even though that we will on average still get the right statistics, we’re still averaging our initial result, 60 % with random noise. So if people happen to flip coins in a really unlikely way, we might accidentally think that 95 % of people are jaywalking. It’s only “in expectation” aka when we have an infinite number of samples, an infinite number of participants, that this noise disappears and we get the exact true distribution. Thus we have gained privacy but we’ve lost some accuracy, especially if we’re only sampling over a small number of people. This trend is true throughout the entire field of differential privacy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/0*sej81ZWP5dzszRHR" /></figure><p>Research in differential privacy can thus be grouped into two main themes:</p><ol><li>The main goal of DP is to get the most accurate query results with the greatest amount of privacy, aka how can we minimize the amount of noise that we are adding,while maximizing the amount of privacy.</li><li>The second goal is derivative of this, which looks at who trusts or doesn’t trust each other in a real world situation. Because if you add noise to protect two people who do trust each other, that noise was wasted and your query was less accurate than necessary. But if you forget to add noise between two people who don’t trust each other, meaning a database curator and an individual, then you put one of them more at risk. So we want to minimize a noise accuracy tradeoff. One of the strategies there is to create flexible differential privacy strategies which fit with how people actually do and don’t trust each other in the real world. But enough on that.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/541/0*Tvyr6zfqVooNOlRR" /></figure><p><strong>#Project Demo Implement Local Differential Privacy</strong></p><p>In this project, we’re going to implement simple local differential privacy using randomized response from scratch in Python.</p><p>Specifically, we’re actually going to implement in Python, the coin flipping example .</p><p>If you have a group people that you’re wishing to survey about a very taboo behavior, then we are given these interesting instructions as to how they should answer. So they flip a coin two times and if the first coin flip was heads, they should answer honestly. However, if he first coin flip was tails, they should answer according to a second coin flip. What this does, is this gives each person plausible deniability while simply averaging across all of their answers with a 50 percent probability of saying yes or no.Thus, if we sample across a 1000 people, we would carry this over 1000 people. We interrogate a 1000 people with this question, and around 60 percent of them answer, yes. Then we know that the true distribution is 70 percent because 70 percent, the true distribution has been averaged with 50 percent to get the the output of our statistical survey.</p><p>The query function we’re going to use is a mean function.Let’s say we have a database of size 100.</p><p>db, pdbs = create_db_and_parallels(100)</p><p>db</p><p>tensor([1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0,</p><p>0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,</p><p>1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1,</p><p>0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,</p><p>0, 1, 0, 0], dtype=torch.uint8)</p><p>The true result is the mean of the database.</p><p>true_result = torch.mean(db.float())</p><p>true_result</p><p>tensor(0.4700)</p><p>Since we generate our database randomly,with 50 percent probability of being one or zero, the mean tends to be around 0.5.</p><p>tensor(0.4700)/tensor(0.4500)/tensor(0.4400)/tensor(0.5200)</p><p>However, we want to noise our dataset using local differential privacy. Local differential privacy is all about adding noise to the data itself. So in our case, adding noise to the data means replacing some of these values with random values:</p><p>tensor([1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0,</p><p>0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0,</p><p>1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1,</p><p>0, 1, 1, 0, 1, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,</p><p>0, 1, 0, 0], dtype=torch.uint8)</p><p>If you remember, from this randomized response, like sometimes they answer honestly, so these would be the honest results in our example. Sometimes, they answer according to a coin flip, they answer randomly.</p><p>First thing we need to do is actually flip two coins a 100 times:</p><p>first_coin_flip = (torch.rand(len(db)) &gt; 0.5).float() (we get a 50–50 chance of flipping heads or tails. In this case, 50% of times to get a 0.0 or 1.0 from our random number generator)</p><p>Our first coin flip for every single value in this database tensor:</p><p>tensor([0., 1., 1., 0., 0., 1., 0., 0., 0., 1., 0., 0., 0., 0., 0., 1., 0., 1.,</p><p>0., 1., 1., 0., 0., 0., 1., 0., 0., 1., 1., 1., 0., 1., 1., 0., 0., 0.,</p><p>1., 1., 1., 1., 0., 0., 0., 0., 0., 1., 1., 1., 1., 1., 1., 0., 0., 0.,</p><p>1., 0., 0., 1., 0., 1., 0., 1., 1., 0., 1., 0., 1., 1., 1., 1., 1., 0.,</p><p>1., 0., 0., 0., 0., 1., 0., 1., 0., 0., 0., 1., 0., 0., 1., 0., 1., 0.,</p><p>0., 1., 0., 0., 1., 1., 1., 1., 1., 0.])</p><p>Let’s do this and create a second coin flip. This first coin flip is going to determine whether we want to use the value it’s actually going to database, or whether we want to use the value that was randomly generated according to this second coin flipper.</p><p>tensor([0., 1., 1., 1., 0., 1., 1., 0., 0., 1., 0., 1., 0., 1., 1., 0., 0., 1.,</p><p>1., 1., 0., 0., 1., 1., 1., 0., 0., 0., 1., 1., 0., 0., 1., 0., 0., 0.,</p><p>1., 1., 0., 1., 0., 1., 0., 1., 1., 0., 1., 0., 1., 0., 0., 1., 1., 0.,</p><p>1., 0., 0., 1., 0., 0., 1., 0., 1., 0., 1., 1., 1., 0., 0., 0., 1., 1.,</p><p>0., 0., 1., 0., 0., 1., 0., 0., 0., 1., 1., 0., 0., 0., 0., 1., 1., 0.,</p><p>0., 0., 1., 1., 0., 1., 0., 0., 1., 1.])</p><p>We can do this to create our noisy database or synthetic database or augmented database. We’ll call it augmented in the following way: half the time, if the coin flip is one, then we want to use the database.So it was a heads answer honestly which we’ll call one heads. The nice thing here is, we can do this by simply just multiplying first coin flip by database, because this acts as a mask.The multiplying it times a one, will leave in wherever the database is and multiplying it times a zero will zero out any values in the database. Will return database times first coin flip, returns a one only for the places in the database where there actually was a one originally. sometimes we need to choose randomly.</p><p>db.float() * first_coin_flip</p><p>tensor([0., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,</p><p>0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0.,</p><p>1., 0., 1., 1., 0., 0., 0., 0., 0., 1., 1., 0., 0., 1., 1., 0., 0., 0.,</p><p>0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 1., 0., 0., 1., 1., 0.,</p><p>1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,</p><p>0., 1., 0., 0., 1., 0., 1., 1., 1., 0.])</p><p>So if</p><p>((1-first_coin_flip))</p><p>tensor([0., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,</p><p>0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0.,</p><p>1., 0., 1., 1., 0., 0., 0., 0., 0., 1., 1., 0., 0., 1., 1., 0., 0., 0.,</p><p>0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 1., 0., 0., 1., 1., 0.,</p><p>1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,</p><p>0., 1., 0., 0., 1., 0., 1., 1., 1., 0.])</p><p>here’s all the places where we want to actually choose randomly All of these ones that you see here, we want it to actually sample from the second coin flip.We can do this by simply sampling or multiplying times the second coin flip:</p><p>(1-first_coin_flip)*second_coin_flip</p><p>tensor([0., 0., 0., 1., 0., 0., 1., 0., 0., 0., 0., 1., 0., 1., 1., 0., 0., 0.,</p><p>1., 0., 0., 0., 1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,</p><p>0., 0., 0., 0., 0., 1., 0., 1., 1., 0., 0., 0., 0., 0., 0., 1., 1., 0.,</p><p>0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 1.,</p><p>0., 0., 1., 0., 0., 0., 0., 0., 0., 1., 1., 0., 0., 0., 0., 1., 0., 0.,</p><p>0., 0., 1., 1., 0., 0., 0., 0., 0., 1.])</p><p>So here’s all the values that are being sampled randomly.</p><p>If we simply add these together, then we get a new augmented database, which is differential private:</p><p>augmented_database= db.float() * first_coin_flip +(1-first_coin_flip)*second_coin_flip</p><p>torch.mean(augmented_database.float())</p><p>tensor(0.4400)</p><p>=&gt; we augment the database and we can just go ahead and use this. However, something else has happened here, half of our values are honest and half of our values are always going to have a mean or try to have a mean, that’s at 0.5.This means that it’s going to skew the output of our query towards 0.5.Because half the time,we’re using the values that are from the second coin flip,which has a 50/50 chance of being positive or being heads or tails.Let’s just say the database had,on average was 70 % of the time that people said true for whatever the taboo behavior was.Let’s say that 70 % of these were true,so that the mean of this would be 0.7.That would mean that if we took half the values from here and half the values from this randomly generated 50/50 distribution,then the mean of them would shift from this where the mean was 0.7 and this where the mean was 0.5, would be halves between them. The mean would then be 0.6 even though the original distribution was 0.7.</p><p>Means is almost like this query is now skewed as a result of the noise. Skewing was not all we were after, what we wanted to do was just give each individual person plausible deniability.</p><p>In conclusion we have to do one final step here, which is deskew the result.</p><p>Let’s say for example, there’s a distribution here where there’s a certain averages here and we’ll say it’s 70 %. The average of this coin flip, is always going to be 50 %. If we are half from here and half from here is 60 %, then we can just do that in reverse. So that means that if the output of our augmented database gives us a mean of 60 %, well, then, we know that it’s really trying to tell us 70 % because half of our data is just 50/50 random noise. Let’s try to deskew this result by:</p><p>dp_result=torch.mean(augmented_database.float())*2–0.5</p><p>tensor(0.3800)</p><p>This is the true output of our database. Because I have removed the skewed average that was a result of this local differential privacy or this second coin flips. So this is actually the output of our augmented result, so our augmented differentially private result. We’ll call it db_result.</p><p>We can package all this as a single query and see what was in our assignments. So in our assignment, we needed to return the augmented result,that differentially private result. We also want to return the true result, because the notion of this and what we wanted to learn from this lesson is actually to understand how these results tend to change:</p><p>def query(db):</p><p>true_result=torch.mean(db.float())</p><p>first_coin_flip = (torch.rand(len(db)) &gt; 0.5).float()</p><p>second_coin_flip = (torch.rand(len(db)) &gt; 0.5).float()</p><p>augmented_database= db.float() * first_coin_flip +(1-first_coin_flip)*second_coin_flip</p><p>dp_result=torch.mean(augmented_database.float())*2–0.5</p><p>return dp_result,true_result</p><p>query(db)</p><p>(tensor(0.5400), tensor(0.5200))</p><p>What we want to do here, is work on databases at different sizes. The assignment here were supposed to do a database of size 10. Then look at the private result, true results. We’ll print this out here so it’s easy to see.What we’re going to see when we compare that noise really throws things off sometimes</p><p>db,pdbs=create_db_and_parallels(10)</p><p>private_result,true_result=query(db)</p><p>print(“Whith noise: “+str(private_result))</p><p>print(“Without noise: “+str(true_result))</p><p><strong>Whith noise: tensor(-0.1000)</strong></p><p><strong>Without noise: tensor(0.5000)</strong></p><p><strong>but let’s use a bigger dataset:</strong></p><p>db,pdbs=create_db_and_parallels(100)</p><p>private_result,true_result=query(db)</p><p>print(“Whith noise: “+str(private_result))</p><p>print(“Without noise: “+str(true_result))</p><p><strong>Whith noise:tensor(0.6000)</strong></p><p><strong>Without noise:tensor(0.5400)</strong></p><p><strong>Let’s use an even bigger dataset:</strong></p><p>db,pdbs=create_db_and_parallels(1000 )</p><p>private_result,true_result=query(db)</p><p>print(“Whith noise: “+str(private_result))</p><p>print(“Without noise: “+str(true_result))</p><p><strong>Whith noise:tensor(0.4840)</strong></p><p><strong>Without noise:tensor(0.4820)</strong></p><p><strong>Then, even bigger dataset.</strong></p><p>db,pdbs=create_db_and_parallels(10000)</p><p>private_result,true_result=query(db)</p><p>print(“Whith noise: “+str(private_result))</p><p>print(“Without noise: “+str(true_result))</p><p><strong>Whith noise:tensor(0.4834)</strong></p><p><strong>Without noise:tensor(0.5016)</strong></p><p>Local differential privacy and differential privacy in general:</p><p>Whenever we’re adding noise to a distribution, were corrupting it. So the statistics that the queries that we’re doing are going to be sensitive to this noise. However, the more data points that we have, the more this noise will tend to average out. It will tend to not affect the output of the query because on average,across a large number of people,sometimes the noise is making the result higher than it should be or lower than the result should be. But on average, it’s actually still centered around the same mean of the true data distribution. In particular, a general rule of thumb, which is local differential privacy is very data hungry. In order to be able to noise the dataset, you’re adding a ton of noise, we’re adding noise to every single value in the dataset. So when we have 10,000 entries, we’re adding 10,000 bits of noise. I guess like with 50 % probability. So it probably more like 5,000 bits of noise, but that’s still a lot of noise.</p><p>Global differential privacy, in contrast, only adds noise to the output of the query. We will find that this tends to be quite a bit more accurate and a little less data hungry than local differential privacy. If you want to implement local differential privacy and protect data at the data level, protect the dataset itself. Then, you’ll want to use local differential privacy, that we want to make sure you have a really large dataset. Whereas, if you want to use a less data hungry algorithms and maybe your dataset is smaller but you still need to protect it, then it’s better to lean towards global differential privacy. In general, I think personally leaning towards global differential privacy seems to be where a lot of the field is going although obviously the local db has its advantages. The event the local db is that in theory you could publish some of these datasets. So you don’t have to trust someone to lower trust settings</p><p>Just understand this notion of this trade off between small datasets and and large datasets. Meaning that your noise creates vastly different outputs of the queries, versus only slightly different outputs of the queries when you have a large enough dataset to average the noise over.</p><p><strong>#Project Demo Varying the Amount of Noise</strong></p><p>In this project, we’re going to take the code that we wrote in the last section and we’re going to add one extra feature. That extra feature is that we’re going to make it so that we can bias</p><p>the first coin flip to be arbitrarily more likely or less likely to be heads. The thing that we’re going to need to change is how we actually reskew the output of our mean query later.</p><p>So the first thing we’re going to do is go ahead and copy this query:</p><p>def query(db):</p><p>true_result=torch.mean(db.float())</p><p>first_coin_flip = (torch.rand(len(db)) &gt; 0.5).float()</p><p>second_coin_flip = (torch.rand(len(db)) &gt; 0.5).float()</p><p>augmented_database= db.float() * first_coin_flip +(1-first_coin_flip)*second_coin_flip</p><p>dp_result=torch.mean(augmented_database.float())*2–0.5</p><p>return dp_result,true_result</p><p>We have this first coin flip and we determine the likelihood of this coin flip to be a heads or tails based on this threshold. The torch code here actually,these outputs, a random distribution of numbers between zero and one:</p><p>torch.rand(len(db))</p><p>If we look at here, it’s a bunch of random numbers, just uniformly random between zero and one:</p><p>tensor([0.8328, 0.7786, 0.8227, …, 0.7056, 0.5253, 0.2505])</p><p>We threshold it by: (torch.rand(len(db)) &gt; 0.5).float() that say 50 % of them on average are above the threshold and 50 % are below.</p><p>What we want to do in this section (torch.rand(len(db)) &gt; 0.5) is we want to make this adjustable.We want to make this a noise parameter which actually sets the likelihood that the coin flip will be a heads:</p><p>def query(db,noise=0.2):</p><p>true_result=torch.mean(db.float())</p><p>first_coin_flip = (torch.rand(len(db)) &gt; noise).float()</p><p>second_coin_flip = (torch.rand(len(db)) &gt; 0.5).float()</p><p>augmented_database= db.float() * first_coin_flip +(1-first_coin_flip)*second_coin_flip</p><p>dp_result=torch.mean(augmented_database.float())*2–0.5</p><p>return dp_result,true_result</p><p>The interesting thing here is all the rest of the pieces are really the same.So the first coin flip, we’ve modified with this a little bit.The second coin flip is still a random distribution between a 50/50 coin flip,just sometimes we’re more or less likely to actually rely on the second coin flip depending on the likelihood that our first coin flip is a heads or tails.Augmented database is still created in the same way because it’s still based on these two coin flips. The part that’s different however is how we reskew the results for this mean query later.</p><p>Because the nature of this average is based on the idea that we are reskewing the data set to have the same average, to have the same mean as the original database. We take whatever the actual database was. So in one example earlier, we mentioned that perhaps 70 % of people on average answered true to whatever the question was.We take whatever this distribution is so that we’ll say it’s centered around 0.7 and we average it with a distribution that is centered around 0.5, then that returns a distribution if they’re weighted evenly that’s averaged around 0.6. So we had a true distribution mean, let’s just say it was 0.7.Then we say that our noise distribution, we’ll say it’s 0.5 because it’s a random coin flip.</p><p>true_dist_mean= 0.7 # 70% of people said yes</p><p>nois_dist_mean= 0.5 #50/50 coin flip</p><p>this means that the augmented database mean is going to be :</p><p>augmented_database_mean= (true_dist_mean+nois_dist_mean)/2</p><p>augmented_database_mean</p><p>output:tensort: 0.6</p><p>However, we want to get rid of this random noise on average while still keeping the noise that we actually put on each individual entry. More importantly, if we are more or less likely to choose as distribution,we want to make sure that however we reskew ,we can properly deskew it according to this noise parameter(noise=0.2). How we really do here is we actually sort of run this mean in reverse.We’re unaveraging the output of the query.</p><p>First, we’re going to create a sort of in which it’s actually our skewed query.</p><p>Our skewed result,which equals augmented database dot float dot mean.</p><p># try this project here!</p><p>#def query(db,noise=0.2):</p><p>noise=0.2</p><p>true_result=torch.mean(db.float())</p><p>first_coin_flip = (torch.rand(len(db)) &gt; noise).float()</p><p>second_coin_flip = (torch.rand(len(db)) &gt; 0.5).float()</p><p>augmented_database= db.float() * first_coin_flip +(1-first_coin_flip)*second_coin_flip</p><p>sk_result=augmented_database.float().mean()</p><p># return dp_result,true_result</p><p>Sk_result</p><p>output:tensor(0.4800)</p><p>if we say our noise parameter</p><p>noise=0.5# 50/50 coin flip first coin flip,which meant that 50 percent of the time,</p><p>we use the true distribution with a mean of 0.7:</p><p>true_dist_mean= 0.7 # 70% of people said yes</p><p>nois_dist_mean= 0.5 #50/50 coin flip in our original example,this was 50/50 first coin flip,which meant that 50 percent of the time,we use the true distribution with a mean of 0.7,</p><p>and 50 percent of the time,we use a distribution that also had 0.5.</p><p>Another way of thinking about this is that our true distribution mean was being multiplied by noise.So half of the time, we’re using this distribution,and the other half of the time,we were using noise distribution mean one minus noise.</p><p>augmented_database_mean= (true_dist_mean* noise)+(nois_dist_mean*(1-noise))</p><p>Augmented_database_mean</p><p>output:0.6</p><p>How do we reverse this? Well, basically we can do simple algebra and pull out what the true distribution mean was by removing all these other terms.For de-using all these different terms. It’s going to be a multiplications attraction component because we want to get</p><p>out this value or at least deskew this value according to these others:</p><p>We take our skewed result,and we say our final or augments result or private result is going</p><p>to equal our skewed result divided by our noise minus 0.5,and the 0.5 is this 0.5 right here.</p><p>Then, we’re going to multiply this times noise divided by one minus noise.The deal that’s going on right here is what we’re basically deskewing these results so that</p><p>our private result has its mean adjusted according to this noise parameter.</p><p>So this noise parameter was at 0.5,then the skewed result,the distance between a skewed result and the private result is basically this is halfway between the true mean of distribution, and the mean of the distribution of 50/50 coin flip. So notice that 0.5. So 0.5 minus 0.4929, 0.5 minus 0.4858. This is roughly half of this, so we’re doubling the distance because there was a 50/50 average. So as we can see, this is the correct algebraic deskewing formula.</p><p>Then we return to the same things we did before.Okay. Now, we want to do a similar experiment to what we did last time.</p><p>def query(db, noise=0.2):</p><p>true_result = torch.mean(db.float())</p><p>first_coin_flip = (torch.rand(len(db)) &gt; noise).float()</p><p>second_coin_flip = (torch.rand(len(db)) &gt; 0.5).float()</p><p>augmented_database = db.float() * first_coin_flip + (1 — first_coin_flip) * second_coin_flip</p><p>sk_result = augmented_database.float().mean()</p><p>private_result = ((sk_result / noise) — 0.5) * noise / (1 — noise)</p><p>return private_result, true_resul</p><p>Experiment 2 : instead of varying the size of the database,we want to vary the amount of noise that we’re adding to the database. So we’re going to keep the database with size of 100.Then, we’re going to have this noise parameter.</p><p>Let’s start at like 0.1,</p><p>db, pdbs = create_db_and_parallels(100)</p><p>private_result, true_result = query(db, noise=0.1)</p><p>print(“With Noise:” + str(private_result))</p><p>print(“Without Noise:” + str(true_result))</p><p>With Noise:tensor(0.5667)</p><p>Without Noise:tensor(0.5600)</p><p>it’s relatively low noise 0.2,</p><p>db, pdbs = create_db_and_parallels(100)</p><p>private_result, true_result = query(db, noise=0.2)</p><p>print(“With Noise:” + str(private_result))</p><p>print(“Without Noise:” + str(true_result))</p><p>Whith noise:tensor(0.4625)</p><p>Without noise:tensor(0.4400)</p><p>db, pdbs = create_db_and_parallels(100)</p><p>private_result, true_result = query(db, noise=0.4)</p><p>print(“With Noise:” + str(private_result))</p><p>print(“Without Noise:” + str(true_result))</p><p>Whith noise:tensor(0.4333)</p><p>Without noise:tensor(0.5500)</p><p>and we’re just going to keep doubling and see what happens</p><p>db, pdbs = create_db_and_parallels(100)</p><p>private_result, true_result = query(db, noise=0.8)</p><p>print(“With Noise:” + str(private_result))</p><p>print(“Without Noise:” + str(true_result))</p><p>Whith noise:tensor(1.1500)</p><p>Without noise:tensor(0.4600)</p><p>As we increase the amount of noise, the difference between on average starts getting quite a bit more.</p><p>But if we counter this with a large dataset,then they come back together.</p><p>db, pdbs = create_db_and_parallels(10000)</p><p>private_result, true_result = query(db, noise=0.8)</p><p>print(“With Noise:” + str(private_result))</p><p>print(“Without Noise:” + str(true_result))</p><p>With Noise:tensor(0.5195)</p><p>Without Noise:tensor(0.5056)</p><p>The size of the data set allows you to add more noise or more privacy protection to the individuals who are inside the dataset. The counter-intuitive thing here is that the more private data you have access to, the easier it is to protect the privacy of the people who were involved.The larger this corpus of dataset is, the more noise you can add while still getting an accurate result.</p><p>Now, in society, this is actually probably even more counter-intuitive because people think of preserving privacy is as giving statistician’s access to less and less data, but in fact, with differential privacy, the opposite is true. Because the intuition behind differential privacy is about saying we want to learn about an aggregation over a large corpus. We want to learn something that is common about many different people.</p><p>So one thing might be, let’s say you’re performing statistical analysis of medical records.</p><p>Let’s say you’re going to identify tumors inside of MRI scans. You have a collection of say 1,000 images that have the tumors annotated so you’re trying to learn how to detect tumors inside of individuals. When you’re performing a statistical analysis, you’re not actually interested in whether any one of these people has a tumor. Now, you’re not trying to violate any particular person’s privacy, instead, you’re trying to do a statistical study to understand what do tumors in humans look like. You’re actually trying to go after information that is fundamentally public but just happens to be buried inside of individual private data points.</p><p>More importantly, the way in which this technology works is that the differential privacy is a very complex kind of filter and the way that the differentially private filter works is that it looks for information that is consistent across multiple different individuals. It tries to filter out perfect differential privacy so no information leakage would, in theory, be able to block out any information that is unique about participants in your dataset and only let through information that is consistent across multiple different people,aka allowing you to learn what do tumors in humans look like without learning whether any individual person that you were studying actually had a tumor. That’s the nature of this kind of a filter that differential privacy allows us to have.But it’s only allowed to look for repeating statistical information inside the dataset.So if you have a really small data set,the odds of it finding the same statistical pattern twice are actually pretty low because you only have a few people to look at. If you have a dataset of five images, every image is totally unique, everything’s going to look like it’s totally private information, differential privacy will have to get rid of all the data, it won’t let anything through, even a small amount of noise will totally corrupt the output of your query.</p><p>However, if you have say a million images or maybe, in this case, we have 10,000 entries:</p><p>db, pdbs = create_db_and_parallels(10000)</p><p>private_result, true_result = query(db, noise=0.8)</p><p>print(“With Noise:” + str(private_result))</p><p>print(“Without Noise:” + str(true_result))</p><p>With Noise:tensor(0.5195)</p><p>Without Noise:tensor(0.5056)</p><p>then it becomes a lot easier to learn about general characteristics in the dataset because you have more data points to look at and compare with each other to look for a similar statistical information.</p><p>What are differentially private mechanisms? It’s a mechanism that study a dataset and filter out any information that is unique to individual points in your dataset and try to let through information that is consistent across multiple different people in your dataset. This is why one of the big takeaways from this project in this lesson is really that the larger the corpus of information that you can work with, the easier it is for you to protect privacy because it’s easier for your algorithm to detect that some statistical information is happening in more than one person, and thus is not private or unique or sensitive to that person because it’s a general characteristic of humans more and more generally.</p><p><strong>#The Formal Definition of Differential Privacy</strong></p><p>We’re going to create a database with our query and then analyze</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*G4FvzKFQSG_sXr7z" /></figure><p>it with the formal definition of DP. We’re going to add noise to the output of our function and we have two different kinds of noise that we can add, Laplacian noise or Gaussian noise :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6zKyRjJf5Zx_3s1R" /></figure><p>(The Laplace distribution is similar to the Gaussian/normal distribution, but is sharper at the peak and has fatter tails.Also, the Laplacian noise is more suited to our applications in differential privacy as it always has a ‘0’ value for the delta parameter).</p><p>In order to know how much noise we should add,we will appear to the formalized definition of DP. This is the definition proposed by Cynthia Dwork.It’s the e equals mc squared of differential privacy.It’s most important formula in the field and it doesn’t create differential privacy necessarily, it’s not a method of adding noise per say. Instead, it’s a constraint so that you can analyze a query with noise and know whether or not this query and noise is leaking too much information. In particular, we have two different measures called Epsilon and Delta, and these compose a threshold for leakage. Now, let me unpack this a little bit for you what this exact inequality is. So the previous method of adding noise that we just worked with in the last session was called local differential privacy because we added noise to each datapoint individually. This is necessary for some situations where in the data is so sensitive</p><p>that individuals do not trust them that noise will be added later. However, it comes at a very high costs in terms of accuracy. So if you’ll remember back to how we actually constructed the coin flipping example, you’ll remember that before an individual gave us their answer, you would query an individual and you would say, hey, are you performing some sort of let’s say activity? Before they gave you they’re true or false value, they would actually flip their coin at that point and so that means that they were adding noise themselves to their individual datapoint before submitting it to you and it’s this local term refers to the fact that they are locally adding noise to the data before it gets sent to you.</p><p>Now, if you’re familiar with the intuitions of say dataset anonymization, even though dataset anonymization is a broken technique and you should use it, it’s probably the closest parallel to local differential privacy to the extent that it is augmenting datapoints individually with the intent of trying to build release.</p><p>But again, don’t do dataset anonymization,don’t advocate people to do dataset anonymization because it’s a fundamentally broken idea. However, this leads us directly into the other kind or the other class of differential private algorithms called global differential privacy.</p><p>Global differential privacy instead of adding noise to individual datapoints, applies noise to the output of a function on datapoints. The advantage in general, and is a little bit of a sweeping statement, but the advantage in general is that you can often add a lot less noise and get a much more accurate result if you wait to add the noise until after you’ve computed a function, and the reason for this is that many functions actually reduce the sensitivity involved.</p><p>So for example, here we have a query or a database, in differential privacy would add noise to individual datapoints for the sake of protecting when we were simulating the coin flipping example.</p><p>db, pdbs = create_db_and_parallels(100)</p><p>def query(db):</p><p>return torch.sum(db.float()<strong>+noise</strong>)</p><p>def M(db):</p><p>query(db) + noise</p><p>query(db)</p><p>Have a global differential privacy would add noise out here to the output of a function:</p><p>db, pdbs = create_db_and_parallels(100)</p><p>def query(db):</p><p>return torch.sum(db.float())<strong>+noise</strong></p><p>def M(db):</p><p>query(db) + noise</p><p>query(db)</p><p>Now, this doesn’t have to be just a single function, this can be a big long chain of functions,</p><p>it could be a sum and a threshold and then another some and then multiplication or any any number of functions that we wanted to chain together and we can add noise in the middle or at the end wherever we wanted to do this.</p><p>As a general rule of thumb, as you process data more and more, it is quite common for sensitivity to go down. So a good place to start, if you’re trying to figure out where you want to add noise in your system and your pipeline, is to lean more towards doing it as late in</p><p>the chain as possible because the later you go, the more individuals you have likely aggregated over, the more processing you have done, the more likely you will have</p><p>done to do thresholds or squishing functions like Sigmoids or ReLu or any other kinds of post-processing on your data.</p><p>The better the chances are that you’ll do things that actually reduce some sensitivity and actually end up reducing the amount of noise that you have to add giving you a more accurate result with less privacy leakage.</p><p>So if the data is so sensitive, the people aren’t going to give it to you then people tend to lean more towards <strong>local differential privacy</strong> because the individual data owners are just sort of so scared that they want to protect their data before they handed over to what’s called a trusted curator, who is the party that is generally referred to as the one who’s actually performing differential privacy.</p><p>That’s the reason that most people use local DP, use local differential privacy whereas people who use <strong>global differential privacy </strong>when they’re more interested in saying:</p><p>“Hey, I really need the output of this to be accurate while still having the same level of privacy”.</p><p>So if there’s a trade-off between how much the data owner is willing to trust the person performing differential privacy here. So if you can facilitate a setup, where differential privacy is being performed over a large dataset and they can trust the you’re performing differential privacy correctly, would strongly advocate for you to lean towards global differential privacy because it can be a much more accurate method of stripping out private information.</p><p>How do we actually measure how much privacy is being leaked inside of a differentially private algorithm?</p><p>Differential privacy itself,the most well-known, has been proposed by Cynthia Dwork,differential privacy typically build on top of this one for one purpose or another purpose:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*U6niIRj68H_YA_iv" /></figure><p>Let’s reread this a bit more intuitively: A randomized algorithm M, M being a randomized algorithm :</p><p>def M(db):</p><p>query(db) + noise</p><p>This would be a globally differential private randomized algorithm. It’s some sort of function on a database with some sort of noise added to it. Now, this noise could have been inside the db or applied to the db which in case it would have been locally differentially private. We have we don’t know what algorithm is S, we just know that it has the ability to query a database and it is randomized in some way.</p><p>That’s what we know about M and it has an output domain of Nx.Meaning it could be a histogram over certain entries in database. So, it’s discretized in this particular case and we’re saying that this is epsilon delta differentially private if for all the potential things that it could predict. So for all for things S in the range of M and for all database pairs parallel of databases such that x minus y is less than equal to 1. Actually, these are these are histograms over pair databases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n98HCYxzyp7BznBB" /></figure><p>And Mx counts how many times each thing happened in the database, how many times it was a database full of marbles.</p><p>I don’t know, in each each entry had a marble of a specific color. This might count the number of red marbles and blue marbles, the number of yellow marbles right in which case,</p><p>this would be three natural numbers and the size of x would be three and of course their natural numbers because we’re counting individual things. Its discretized, the differential privacy definition is post in the form of a histogram over a database. we’re saying there are two histograms right, and the max distance between these two histograms is one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NTYerkf57A20EFux" /></figure><p>Meaning that they only differ in one entry, and they are parallel databases.</p><p>Let’s just walk through this one more time just to make sure that you understand this setup. This definition. A randomized algorithm m with a domain Nx meaning that is it’s their natural numbers, the x and actually earlier in this paper, it was identified that this was referring specifically to a histogram over database is epsilon delta differentially private if, for all the things that M could predict, all the potential outputs of m for all and for all the potential inputs that are parallel databases right and this is the part of the thing.</p><p>The setup is two histograms, one is the full database, one is database with one entry missing and this constraint is true:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*atJPtOIzx3gReiK6" /></figure><p>So, what is this constraint?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9vpYblZrgl-Ho_aV" /></figure><p>is actually taking our mechanism and running it over this histogram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mnDaTBrHMxOifJay" /></figure><p>is doing the same thing over any every parallel database with one entry missing, this threshold has to be true for all databases.</p><p>What is the distance between the distribution over all the things in the database</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/0*qDxZ6BNrGv94-B-6" /></figure><p>,the probability distribution over all things database versus the probability distribution over all the things in the database minus one entry</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/0*wl4SjcREvExd4XXI" /></figure><p>.</p><p>So,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/0*hmvOdECOP07xAqHV" /></figure><p>random distribution over things in the database, objects in the database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/0*UU22k_Brh0trbM9a" /></figure><p>Random distribution over objects in the database with one entry missing.</p><p>The question that is that the core focus of differential privacy is how different are these two distributions?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sKz1h0F9bO6U3Khw" /></figure><p>How different is the output of my mechanism that the prediction of my mechanism, when I remove an entry from the database? How much does it change from here to here? And the measurement of the maximum amount that these two distributions are</p><p>different is measured by two parameters: Epsilon 𝜺 and delta.𝝳</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*E0y5UtgC20JmOtb_" /></figure><p>constrains how different these distributions are is an sort of the primary constraint we might say, and some algorithms actually only use 𝜺(epsilon).</p><p>if 𝜺was zero and these distributions (</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/0*ft8_3dIAibtCdGMA" /></figure><p>,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/0*6v8A6iKCC8RykkQ1" /></figure><p>)are identical then</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lZVNzkFRhszjcI9r" /></figure><p>is one,and these distributions are identical.</p><p>If 𝜺 zero 𝝳 zero would be perfect privacy. if this constraint was satisfied at epsilon zero delta zero, then we have no privacy leakage with M on x</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/254/0*GmZ-vUka0OunL5cN" /></figure><p>.</p><p>However, let’s say epsilon was 1, that allows some privacy leakage.But, something that is very important to take away is that something can satisfy differential privacy.</p><p>Delta 𝝳 is the probability, which is usually very small, The probability that you will accidentally leak more information than epsilon claims that you will leak.Delta is often you know,0.00001 or something like that or it’s zero, it’s usually a very very small probability when it’s non-zero and it’s basically saying hey, most of the time, you’re able to keep everything underneath this amount of leakage. These distributions are going to be at least as close most of the time,but only this probability will they actually not be, and this is basically saying that, if your query is for just the right thing with just the right random noise some probability,you will accidentally leak more information.</p><p>This constraint of differential privacy and so as you might imagine, a tremendous amount of effort goes into developing really good random algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UanGTx9cnFhiOS1z" /></figure><p>This can be satisfied in a way that is usefull, where we get the most accurate output of our queries possible with the lowest epsilon and delta possible and there are also improvements or modifications to this algorithm or this constraint that seek to modify it in various ways which you can observe for literature and and will lead to some pointers to at the end of the course.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ae9edea57c9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/secure-and-private-ai-writing-challenge/introducing-local-and-global-differential-privacy-7ae9edea57c9">#Introducing Local and Global Differential Privacy</a> was originally published in <a href="https://medium.com/secure-and-private-ai-writing-challenge">Secure and Private AI Writing Challenge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My notes from Lesson 4 #Evaluating The Privacy Of A Function]]></title>
            <link>https://medium.com/secure-and-private-ai-writing-challenge/my-notes-from-lesson-4-evaluating-the-privacy-of-a-function-9aebfaa859dc?source=rss-e8c6cd41e2a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9aebfaa859dc</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[calincan mircea]]></dc:creator>
            <pubDate>Mon, 01 Jul 2019 20:09:20 GMT</pubDate>
            <atom:updated>2019-07-06T02:34:58.775Z</atom:updated>
            <content:encoded><![CDATA[<p>part of :</p><p>#60daysofudacity</p><h4><a href="https://eu.udacity.com/facebook-AI-scholarship">Secure and Private AI Scholarship Challenge from Facebook</a></h4><h4><a href="https://eu.udacity.com/course/secure-and-private-ai--ud185">Secure and Private AI by Facebook Artificial Intelligence</a></h4><p><strong>#60daysofudacity</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/716/0*GAIH4D33dKZkAdaT" /></figure><p>change sensitivity back to max_distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/0*caDPYOOa1DIzr29Z" /></figure><p>What we want do here is really just consolidate this code into a single function which accepts this query function as an input parameter and then returned to sensitivity of this function.This is empirically measuring sensitivity, which will get a sense intuition for, if we were to actually remove you from a database,how much would the query change.But in the real world, we can typically know about sensitivity through other ways.sensitivity and we’re going to accept two parameters:</p><ol><li>the query, which is a function object</li><li>number of entries in the database that we want to query with.</li></ol><p>So here we replace this 5,000 with this in entries variable. Then, we’re going to query the database that we created, calculate the maximum distance from the full database query and every parallel database, and return this max_distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*SmrYlGT9w75ehwks" /></figure><p>Let’s calculate sensitivity of this sum function.As we saw before in the previous video, the sensitivity is one.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/0*VGAuv7xdMH7x-ibw" /></figure><p>If we change query function by cast it to a float and calculate a mean.As you know mean it’s just a sum divided by the number of entries. So we should expect that whereas previously our sensitivity is one because we are dividing this by a large number, this should decrease sensitivity quite significantly =&gt; sensitivity empirical sensitivity here is 0.0005 and this corresponds to the average value in the database.This is typically returning something like 500 or something near 500. =&gt; average value here would be 0.5 divided by the number of entries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/0*UuovsHv78EK9a0DI" /></figure><p>Since this database is randomly generated, if we ran into sensitivity a bunch of times, we’d actually get numbers just above and just below. It would approximate the true sensitivity which is really what this sampling does but as it happens here,it tend to line up with the exact sensitivity of this function.The nice thing about this convenient function here is that we can pass in arbitrary functions. We can empirically get a sense for how much the output of this function changes when we remove a person from a database.Let’s create one of size 20. In this database, every single one of these values corresponds to a different person or we’re sort of assuming this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/0*6JS5_Q1ug64DCrdB" /></figure><p>When removing someone from the database, when calculating every parallel database, the assumption is that none of these are accidentally referring to the same person because the the <em>notion of sensitivity is not about how much the function changes when we remove a value from the database, it’s about how much a function changes when we remove all values corresponding to a person from the database.</em>We care about the sensitivity to people,not necessarily the sensitivity just to individual values.Now, it so happens that that’s the same thing in the databases they’re using right now, but I really wanted to call out this notion just so that you get a feeling for what we’re really trying to calculate here.What we’re really trying to calculate is how much the output value from this function is using information from each individual person database,or is it only an aggregation of the information that actually multiple people are contributing?We’ll find that it’s a lot easier to protect privacy,if the information that’s being returned from our query, the output of this function is actually information that multiple people are contributing to.So we might say intuitive measure here might be a threshold or various other functions which have a much smaller sensitivity profile.</p><p><strong>#Calculate L1 Sensitivity For Threshold</strong></p><p>We will calculate the sensitivity for a new kind of function,and that function is the threshold function. We’re first going to define a new query, which is computing this threshold function, then we’re going to create 10 databases of size 10 and compute this function over them with a threshold of five and calculate the sensitivity each time.</p><p>So, step number one is to create this new query type. def query like we did before, which passes in a database, and then it returns the sum over the database and whether or not that is greater than a certain threshold, which we’ll set the default to be five.The priority that this actually returns a binary value, because it’s either greater than or less than that value =&gt; cast it to a float because this is our sensitivity function, it’s actually equipped to use.</p><p>The interesting thing here is that we run this query on data database.So, let’s say, let’s grab a database iteration function up here.Let’s create 10.So, if we look at database and we just compute a sum over it, notice these changes.There is some deviation,so sometimes it’s going to be greater than a threshold and sometimes it’s going to be less than threshold.If we actually query the database, we see this. sometimes it’s one, sometimes it’s zero and the other interesting need to be consider.db.sum,and let’s look for one that’s six.When db.sum greater than five,returns one or returns true and when it returns one, it’s returning a true, and when it turns zero, it’s actually returning a false.</p><p>When we’re querying the database, we get one. The interesting thing here is that this means that there are going to be a parallel databases that could be a five =&gt; this is the nature of how the output of this querycan change if we remove an individual from the dataset, because if we remove someone it could cause this sum to go from six to five and thus the threshold to go from true to false.</p><p>However, if we have a database with only four people in it for example,well then the query is false ,But no matter who we remove, this query is going to continue to be false because removing someone from the dataset only makes the output of the query smaller. So, this means that for some databases, we would have positive sensitivity and for other databases it seems almost as if we would have no sensitivity because no matter how many people we removed or who we removed, the output of this threshold query is no different sens_f equals sensitivity of the query and number of entries equals five. Now let’s do this 10 times and print out the sensitivity of each the theory actually isn’t holding up It looks as sometimes the sum is greater than one, sometimes it’s greater than five,sometimes the sum is less than five.</p><p>However, the sensitivity itself changes and what these actually correspond to, is a non-zero sensitivity is when the sum of the database is exactly six.</p><p>Because of the sum of the databases is exactly six, then it’s sitting right above the threshold, and so when we remove someone,it can actually drop down to five thus causing the output of the query to be different and the sensitivity to be one.But the rest of the time,when the sum of the database is not six., it’s significantly below or significantly above six,then the database doesn’t change the output of the query.This mean =&gt; in previous examples, we’ve seen a constant sensitivity.We saw some function over binary always has a sensitivity of one,and when our mean had a very consistent sensitivity as well, but this has a variable sensitivity.In a context of say, a sum function,we can simply know that the maximum sensitivity of a sum over a database is the maximum value or maximum range of values that any one of those items that you could remove would take on.In this particular case,however this to be different because the sensitivity here is somewhat dataset specific =&gt;Theoretically, the maximum sensitivity of a threshold is always one as well.Because the maximum amount that they were moving someone from a function including a threshold is one. That’s the most that it can change,you can either go from a one to a zero.However, if we actually take a peek at the data, we can tell that sometimes it’s going to be one and sometimes it’s not going to be one.When implementing differential privacy for the first time,this is how you want to compute sensitivity.“Hey, I’m doing a threshold that means with sensitivity is one,and that’s what I’m going to use.”However, there are some more advanced techniques one of which we’ll look later that actually allows you to kind of take a peek at the data and try to understand what’s called a data conditioned sensitivity.</p><p>#Intro Perform A Differencing Attack</p><p>In this concept, we’re going to explore how to compromise or attack differential privacy.In particular, we want to talk about the simplest attack, which is called a differencing attack.Sadly, none of the functions we’ve looked at so far are differentially private, despite them having varying levels of sensitivity.We’re going to demonstrate this here by using this differencing attack.Let’s say we want to figure out a specific person’s value in the database.If we’re able to perform a query using a sum, all we would have to do is query for the sum of the entire database and then the sum of the entire database without that person. In SQL, this might look something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/455/0*DRUwwd4FsyacYKf5" /></figure><p>As you can see, by comparing these two SQL queries, we can determine whether John Doe actually had cancer.So what I’d like for you to do in the next project is perform this differencing attack using the sum, mean, and threshold query functions we already created.The purpose of this exercise is to give you an intuition for how privacy can fail in these environments.</p><p>#Perform A Differencing Attack</p><p>In this project, we want to perform a basic differencing attack to divulge what the value is in database, specifically the value on row 10.The way we’re going to do this, we’re going to perform two different queries against the database:</p><ol><li>One, which is a query that includes row 10</li><li>A query against the database excluding row 10.</li></ol><p>The idea is we want be able to compare these two different queries and determine what the exact value of row 10 actually is. So the first we want to do is initialize a database, we’ll put a 100 values in it.</p><p>db, _ = create_db_and_parallels(100)</p><p>They’re performing a query with a value that’s missing.As you should be familiar with this point,given the intuitions around difference or privacy that we’ve been formulating,this differencing attack is very close to the heartof the intuitions behind differential privacy. So as we form differential private techniques,we want them to specifically be immune to these kinds of attacks.As we’ll see in a formal definition of differential privacy, this is very,very close to the- there’s a constraint that we must satisfying or satisfy differential privacy to a certain threshold. See you in the next lesson.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9aebfaa859dc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/secure-and-private-ai-writing-challenge/my-notes-from-lesson-4-evaluating-the-privacy-of-a-function-9aebfaa859dc">My notes from Lesson 4 #Evaluating The Privacy Of A Function</a> was originally published in <a href="https://medium.com/secure-and-private-ai-writing-challenge">Secure and Private AI Writing Challenge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My notes from Lesson 3 Introducing Differential Privacy]]></title>
            <link>https://medium.com/secure-and-private-ai-writing-challenge/my-notes-from-lesson-3-introducing-differential-privacy-440c1e84afa9?source=rss-e8c6cd41e2a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/440c1e84afa9</guid>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[calincan mircea]]></dc:creator>
            <pubDate>Wed, 19 Jun 2019 13:08:32 GMT</pubDate>
            <atom:updated>2019-07-06T02:35:05.243Z</atom:updated>
            <content:encoded><![CDATA[<p>part of :</p><h4><a href="https://eu.udacity.com/facebook-AI-scholarship">Secure and Private AI Scholarship Challenge from Facebook</a></h4><h4><a href="https://eu.udacity.com/course/secure-and-private-ai--ud185"><strong>Secure and Private AI by Facebook Artificial Intelligence</strong></a></h4><h3>#Secure &amp; Private AI Program</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/507/0*nV_oTG4moN2sRI_a" /></figure><p>Scientists like us are often extremely constrained in terms of the amount of data they have access to to solve their problems.This challenge is quietly holding back research across society and nearly every person facing industry,Making it more challenging to cure disease or understand complex societal trends.</p><p>The biggest tragedy of the situation is that the more personal to data and the more personal the potential uses of that data in society,</p><p>The more restricted it is from scientists. This means that some of the most important and personal issues in society simply cannot be addressed with machine learning.Because we do not have access to the proper training data.</p><p>But by learning how to do machine learning that protects privacy,</p><ul><li>You can make a huge difference in humanity’s ability to make progress, curing disease, and truly understanding who we are through our data.</li><li>I will be teaching you state of the art techniques for privacy preserving artificial intelligence such as Federate Learning and Differential Privacy,</li></ul><p>#Lesson 1 Introduction</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hn7yNlEhElLd8UDE" /></figure><p><strong>differential privacy in the context of deep learning.</strong></p><p>= is about ensuring that when our neural networks are learning from sensitive data,that they’re only learning what they’re supposed to learn from the data without accidentally learning what they’re not supposed to learn from the data.</p><ul><li>we’re going to walk through differential privacy from the early fundamentals to one of the state-of-the-art methods for training differentially private deep learning models.</li></ul><p>The goal to understand the foundational principles of differential privacy such as how noise is applied or how we define privacy.</p><p>What for ?</p><ul><li>to be able to speak intelligently about the subject to engineers,scientists, and stakeholders;</li><li>to be able to continue to consume differential privacy research as it’s produced.</li></ul><p>#What Is Differential Privacy?</p><p>Differential privacy</p><ul><li>is actually quite a new field;</li><li>It recently started with statistical database queries around 2003 and even more recently,</li><li>has been applied to contexts such as Machine Learning.</li><li>The general goal is to ensure that different kinds of statistical analysis don’t compromise privacy.</li><li>Statistical analysis= training data or database or just a dataset about individuals and we want to make sure that our statistical analysis of that dataset does not compromise the privacy of any particular individual contained within that dataset.</li></ul><p>Robust definition of privacy =</p><ul><li>if after the analysis, the analyzer doesn’t know anything about the people in the dataset.They remain “unobserved”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/0*K2ndnbddGgD3oKPz" /></figure><ul><li>In 1977 “Anything that can be learned from a participant in a statistical database, can be learned without access to the database”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*Ls9lnwFfob5iG056" /></figure><ul><li>Modern definition by Cynthia Dwork who is the “Godfather” of differential privacy. = “Differential privacy” describes a promise, made by a data holder,or curator, to a data subject:”You will not be affected, adversely or otherwise, by allowing your data to be used in any study or analysis,no matter what other studies, data sets,or information sources, are available.”(“The Algorithmic Foundations of Differential Privacy.”)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/0*1I-PgAdyndilDZwd" /></figure><p>#Can We Just Anonymize Data</p><p>“You will not be affected,adversely or otherwise by allowing your data to be used in any study or analysis,no matter what other studies, datasets or information sources are available” =&gt; the most challenging and new ones aspects of differential privacy.</p><p>Example :</p><p>X Netflix competition / Netflix prize, which gave away a million dollars to the team which could build the best movie recommendation system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/0*Dtdr4YdBh7H-X9s9" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/719/0*3tWGTLuF6vrRmaQ4" /></figure><p>Netflix published an anonymized dataset over a 100 million movie ratings from half a million users, so that the teams in the competition could train the machine learning models.</p><p>Specifically, the names of the movies and the username</p><p>that the individuals have been replaced with unique integer ideas.</p><p>=&gt; theory, the dataset didn’t disclose private information about the individuals doing the rating ,they didn’t even disclose the names of the movies being rated either.</p><p>=&gt;Two researchers at the University of Texas where able to de-anonymize both the names of the movies and the names of the individuals using a clever statistical technique. They scraped the IMDB movie review site and use statistical analysis to find individuals who were rating movies on both IMDB and on Netflix. =&gt; de-anonymize a large percentage of the users on Netflix as well as the titles of the movies that they were watching.</p><p>X In 1997,a similar technique was used to de-anonymize health records, by looking at multiple, separate anonymized data sets as well as online voter registration records.Which ultimately led to the re-identification of</p><p>Massachusetts Governor William Weld’s medical records.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/718/0*5PVm7qVpM_qM4qWw" /></figure><p>X</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/0*D2jG79nmU_hin3PO" /></figure><p>2013 a Harvard professor re-identify the names of more than 40 percent of a sample of anonymous participants in a high-profile DNA study, by cross-referencing them with other publicly available datasets.</p><p>This notion of “no matter what” other sources datasets or information sources are available is a huge deal.</p><p>#Introducing The Canonical Database</p><p>We will playing around with PyTorch or Numpy or some statistical tool set or dataset in the context of deep learning.</p><ul><li>Get the first look at privacy in the context of a simple database.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/0*AvYgfWO_qoApzY05" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/0*41Rzm7EVlF19Sfax" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/0*5oNGRMQPTjbsh8We" /></figure><p>Example:</p><p>X If this database we’re regarding cancer, a one might indicate that a person has cancer and a zero might indicate that an individual does not have cancer.</p><ul><li>what are the tools and techniques and the way we should think about these things in order to protect the information while still performing our statistical study?</li><li>how did we define privacy in the context of this example database?</li><li>Well, given that we’re performing some query against the database =&gt;if we remove a person from the database and the query doesn’t change, then that person’s privacy would be fully protected.</li><li>if the query doesn’t change even we remove someone from the database, then that person wasn’t leaking any statistical information into the output of the query.</li><li>Now the big question, can we construct a query which doesn’t change no matter who we remove from the database?</li></ul><p>#Project Demo Build A Private Database In Python</p><ul><li>So in this project, what we want do is we want to take a database that exists, and we want to automatically generate every possible parallel database to that original database.</li><li>In other words, we want to iterate through this database, and at each point,we want to remove an entry,and then copy the rest of the database into a what we call a Parallel database.</li><li>So what we should end up with, is a list of many databases,each of which having one entry removed.</li></ul><ol><li>So first, we’re going to join a function that creates a parallel database where we specify which value in the original database you want to remove,</li><li>We are going to create a second function which iterates over all values in the database,generating a copy with one removed at that index.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/0*fRhdWH0KUts5YxRT" /></figure><p>A database is simply a large tensor with single value missing,so we have database here,the shape of this database is simply of like 5,000, so it’s a vector,</p><p>What we want do is we want to first copy the database, and then remove an entry =&gt; all we’re going do is we’re going to slice off the entries,</p><p>before the one we want to remove, and the entries after the one we want to remove, and concatenate them together with torch.cat()</p><p>Get_parallel_db, and we’re going to pass in two parameters, one being db, and one being the remove_index parameter, which specifies which index we went to remove,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/0*07u2tvwYvxBCPnAW" /></figure><p>Whereas previously, the length of the entire database was 5,000,</p><p>when you remove an entry of course,the shape drops to 4,999.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/0*KvRE1ZgIdjKnsnIz" /></figure><p>Now, interesting thing, so if actually passing an index that did not exist,</p><p>so some large number.It does not throw an error,it simply returns the entire database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/451/0*SrrZCPEBzfVQ2A-z" /></figure><p>The next thing we want do is, we want to write a second function which will iterate over every single value in our first database and create one of these parallel databases with that value removed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*z5OboUXiZIA0jqjK" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/0*D8ozxyYPpEbeZtVz" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=440c1e84afa9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/secure-and-private-ai-writing-challenge/my-notes-from-lesson-3-introducing-differential-privacy-440c1e84afa9">My notes from Lesson 3 Introducing Differential Privacy</a> was originally published in <a href="https://medium.com/secure-and-private-ai-writing-challenge">Secure and Private AI Writing Challenge</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using CUDA Pytorch RuntimeError: Expected object of backend CUDA but got backend CPU running on…]]></title>
            <link>https://medium.com/@calincan2000/using-cuda-pytorch-runtimeerror-expected-object-of-backend-cuda-but-got-backend-cpu-running-on-72648b0d6087?source=rss-e8c6cd41e2a9------2</link>
            <guid isPermaLink="false">https://medium.com/p/72648b0d6087</guid>
            <category><![CDATA[pytorch-challenge]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[udacity]]></category>
            <category><![CDATA[pytorch]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <dc:creator><![CDATA[calincan mircea]]></dc:creator>
            <pubDate>Fri, 21 Dec 2018 08:15:16 GMT</pubDate>
            <atom:updated>2018-12-29T12:22:13.912Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using CUDA Pytorch RuntimeError: Expected object of backend CUDA but got backend CPU running on Jupyter Notebook</h3><p>I just started to review Lesson 4 from PyTorch Scholarship Challenge of Udacity Scholarship .</p><p>After running my exercise I saw that my model is Running on CPU, as you can see in the picture below my PC’s CPU-s are on 100% running:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/890/1*2Hw2oifHo7HToUwDH5AaJQ.png" /></figure><p>So I started to search on internet ,also searching Slack PyTorch Challenge then asking my colleagues from Slack PyTorch Challenge Thanks to: Mariam El-Shakafi, manu_correa, I found the solution on this post :</p><p><a href="https://stackoverflow.com/questions/51605893/why-doesnt-my-simple-pytorch-network-work-on-gpu-device">Why doesn&#39;t my simple pytorch network work on GPU device?</a></p><p>Solution:</p><p>add</p><p>device = torch.device(“cuda:0” if torch.cuda.is_available() else “cpu”)</p><p># Assume that we are on a CUDA machine, then this should print a CUDA device:</p><p>print(device)</p><p>you will get :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YQom_H4WQDrZdLqMOOqroQ.png" /></figure><p>add:</p><p>model = model.to(device)</p><p>you will get :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dNUnrWdA3Lq7-hB0DUhLpQ.png" /></figure><p>add:</p><p>images = images.to(device) <br>labels = labels.to(device)</p><p>you will get :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U3Q7K7piY6BrYC0Wv6GDIQ.png" /></figure><p>CUDA will do a faster results and as you can see below low CPU usage:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*9klWZFRCHGL81Cntbwa8zA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=72648b0d6087" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>