francescomecca.eu/_site/index.html
PesceWanda 8db4d676aa 2017
2017-02-24 07:32:48 +01:00

811 lines
39 KiB
HTML

<!DOCTYPE html>
<html lang="en-us">
<head>
<link href="http://gmpg.org/xfn/11" rel="profile">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<!-- Enable responsiveness on mobile devices-->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1">
<title>
Caught in the Net &middot; La rete ti cattura ma libera il pensiero
</title>
<!-- CSS -->
<link rel="stylesheet" href="/public/css/poole.css">
<link rel="stylesheet" href="/public/css/syntax.css">
<link rel="stylesheet" href="/public/css/hyde.css">
<!-- Icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/public/apple-touch-icon-144-precomposed.png">
<link rel="shortcut icon" href="/public/favicon.ico">
<!-- RSS -->
<link rel="alternate" type="application/rss+xml" title="RSS" href="/atom.xml">
</head>
<body class="theme-base-09">
<div class="sidebar">
<div class="container sidebar-sticky">
<div class="sidebar-about">
<h1>
<a href="/">
Caught in the Net
</a>
</h1>
<p class="lead"></p>
</div>
<nav class="sidebar-nav">
<a class="sidebar-nav-item active" href="/">Home</a>
<a class="sidebar-nav-item" href="/about/">About</a>
<a class="sidebar-nav-item" href="/archive/">Archive</a>
<a class="sidebar-nav-item" href="/contattami/">Contact me</a>
<a class="sidebar-nav-item" href="/feed.xml">RSS</a>
<a class="sidebar-nav-item" href="http://francescomecca.eu:3000/explore/repos">Personal Git</a>
<span class="sidebar-nav-item" href="" >Powered by Jekyll and Hyde</span>
</nav>
<p>&copy; 2017. CC BY-SA 4.0 International </p>
</div>
</div>
<h3 class="masthead-title">
<a href="/" title="Home">Caught in the Net</a>
</h3>
<div class="content container">
<div class="posts">
<div class="post">
<h1 class="post-title">
<a href="/pescewanda/2017/01/11/spazio-digitale-rant-facebook/">
Titolo
</a>
</h1>
<span class="post-date">11 Jan 2017</span>
<p>Non sono una persona che va ai concerti. </p>
<p>La registrazione in studio esplicita i processi logici che l&#39;artista segue per arrivare al processo di consegna e questo mi ha sempre affascinato, in maniera assai maggiore della carica emotiva sprigionata da un concerto di notte.</p>
<p>Ma ci sono due artisti, Dale Crover dei Melvins e Jeff Mangum le cui performance live sono state per me, come spettatore, in qualche modo epifaniche.</p>
<p>Milano, dicembre del 2015, i Melvins stanno concludendo il loro piú recente tour in Europa quando Jeff Pinkus lascia cadere il basso sul pavimento, regola gli effetti sulla pedaliera e lo prende a calci finché non produce la giusta ripetizione di suoni. Lentamente ciascun musicista si allontana dal palco, il basso insistente, ancora a terra.</p>
<p>Quell&#39;esecuzione mi fece riflettere sui processi di produzione che dominano la nostra comunicazione.
Possiamo immaginarci delle fasi. La prima é quella di <strong>sperimentazione</strong> che é tanto piú ovvia quanto immediata e involontaria.</p>
<p>La seconda é quella del <strong>superamento</strong>. Superamento é la consapevolezza che il brano composto oggi verrá suonato diversamente domani, é la ragion d&#39;essere delle bozze, anche quando infinite.</p>
<p>La terza e quella piú importante per comprendere le dinamiche di rete é la <strong>dissipazione</strong>.
Attraverso la <em>dissipazione</em> l&#39;opera, che fissata nel momento aveva acquisito una propria dimensione di senso, é costretta a ripiegarsi su se stessa, vana si perde a cause dell&#39;assenza di memoria.</p>
<h2 id="le-dinamiche-della-rete">Le dinamiche della Rete</h2>
<p>In rete l&#39; <strong>accanimento</strong> si sostituisce alla <em>dissipazione</em>.</p>
<p>L&#39; <em>accanimento</em> é il motivo per cui qualche migliaio di uomini di qualsiasi fattura sociale si riuniscono in <a href="http://archive.is/g6wDr#selection-989.483-989.484">gruppi</a> e condividono foto delle loro mogli, fidanzate e qualche amica. Non c&#39;é nessuno scandalo nella foto in sé, sono scatti quotidiani spesso &quot;rubati&quot; dagli stessi profili delle donne riprese.</p>
<p>Ne ha parlato <a href="http://espresso.repubblica.it/inchieste/2017/01/17/news/stupro-su-facebook-ecco-cosa-si-dicono-gli-uomini-che-umiliano-le-donne-1.293546">Repubblica</a>, se ne é parlato su <a href="https://www.reddit.com/r/italy/comments/5nqtgt/una_ragazza_su_facebook_ha_denunciato_lesistenza/">reddit</a>, perfino <a href="http://i.imgur.com/Of41aQ0.jpg">Mentana</a> nella sua ridicola posizione da cavaliere bianco di Facebook ha urlato contro questo fenomeno.</p>
<p>Fenomeno che dal mio punto di vista nasce da una difficoltà di alcuni abitanti della rete ad affrontare l&#39;assenza di dissipazione nella comunicazione online.</p>
<p>Le macchine non ricordano eppure non smettono di ricordarci, anzi invadono il nostro spazio in rete con un continuo susseguirsi di foto e momenti di vita delle altre persone.
Gli algoritmi non seguono il pacato moto del nostro tempo online e anzi lo spezzano, lo frammentano in attimi che hanno il ritmo di un giro della rotella del mouse, lo scorrere di un pollice.</p>
<h2 id="ignorare-per-dimenticare">Ignorare per dimenticare</h2>
<p>Quando Internet, almeno nel mio immaginario, era una terra desolata frequentata da meno di &quot;un miliardo di iscritti&quot;, definivo i troll come utenti piú o meno sveglio che cercano di distruggere una community online inflitrandola e seminando odio fra gli utenti. </p>
<p>In un mondo dove i troll usano il proprio nome e cognome fra le pagine di un&#39;azienda americana preferisco pensare che i troll non sono altro che alla ricerca di attenzione o di un senso di comunità piú o meno sano.</p>
<p>E` per questo motivo che su 4chan si é passati gradualmente dal postare: &quot;Do not feed the trolls&quot; a &quot;Don&#39;t bait&quot;, in riferimento ad una <a href="https://en.wikipedia.org/wiki/Trolling_(fishing)">vecchio tecnica di pesca</a>.</p>
</div>
<div class="post">
<h1 class="post-title">
<a href="/pescewanda/2016/11/15/machine-learning-PARTE3/">
Capire il Machine Learning (parte 3)
</a>
</h1>
<span class="post-date">15 Nov 2016</span>
<h2 id="riconoscimento-delle-immagini">Riconoscimento delle immagini</h2>
<p>Il machine learning viene utilizzato anche per il riconoscimento delle immagini.
La tipologia di rete neurale utilizzata per questa applicazione è chiamata rete neural a convoluzione ( <strong>convolutional neural networks</strong>), abbreviata CNN.</p>
<p>Innanzitutto consideriamo che ogni immagine può essere codificata come una matrice di valori</p>
<p><img src="/wp-content/uploads/2016/8.jpg" alt="pixel"></p>
<p>Vediamo ora quali sono le operazioni compiute da una <strong>CNN</strong> per riconoscere delle immagini.</p>
<h4 id="convoluzione">Convoluzione</h4>
<p>Durante la fase di apprendimento, la rete neurale analizza moltissime immagini (categorizzate) utilizzando dei &quot;filtri&quot;, ovvero delle funzioni che mescolate all&#39;input originale permettono di evidenziare dei pattern nell&#39;immagine.
Questi pattern corrispondono alle caratteristiche proprie di un oggetto (quali possono essere ad esempio per un uccello il becco, le piume, le ali) e nel caso queste sono presenti, possiamo riconoscere l&#39;immagine.</p>
<p>In questo esempio l&#39;immagine di Wally é mescolata (l&#39;operazione si chiama <strong>convoluzione</strong>) con un filtro &quot;a cerchio&quot; che risponde molto bene a caratteristiche come quella di possedere degli occhi.</p>
<p><img src="/wp-content/uploads/2016/bluefilter.png" alt="waldoblue"></p>
<p>La <strong>convoluzione</strong> é un&#39;operazione che ha la proprietá di essere indipendente dalla posizione. Non importa la posizione degli occhi, quando applichiamo la <strong>convoluzione</strong> su un&#39;immagine con un filtro &quot;a cerchio&quot; notiamo che gli occhi sono presenti.</p>
<h4 id="subsampling">Subsampling</h4>
<p>Ogni segnale contiene del &quot;rumore&quot;, ovvero degli elementi che la allontanano dal comportamento ideale. </p>
<p><img src="/wp-content/uploads/2016/ideal.jpg" alt="ideal"></p>
<p><img src="/wp-content/uploads/2016/real.jpg" alt="real"></p>
<p>Attraverso il subsampling possiamo ridurre il rumore e rendere il nostro algoritmo meno suscettibile a queste piccole variazioni; benché l&#39;immagine abbia una risoluzione minore, i pattern rimangono.</p>
<p><img src="/wp-content/uploads/2016/sub.png" alt="waldosub"></p>
<h4 id="connessione-completa">Connessione completa</h4>
<p>Alla fine dell&#39;analisi tutte le caratteristiche estrapolate vengono considerate nell&#39;insieme e in questo modo possiamo capire a quale categoria appartiene l&#39;immagine.</p>
<p>Questo procedimento a livello algoritmo si esplicita con una connessione completa fra tutti i nodi della rete neurale che possono poi restituire l&#39;output (probabilitá che l&#39;immagine appartenga ad una determinata categoria).</p>
<h4 id="fase-di-rinforzo">Fase di rinforzo</h4>
<p>Durante il training é presente un&#39;ultima fase (o strato), chiamato piú propriamente <strong>loss layer</strong>. Questo strato provvede a dare un <strong>feedback</strong> alla rete neurale analizzando l&#39;output in relazione ai dati di partenza (ovvero le immagini giá categorizzate).</p>
</div>
<div class="post">
<h1 class="post-title">
<a href="/pescewanda/2016/11/11/machine-learning-PARTE2/">
Capire il Machine Learning (parte 2)
</a>
</h1>
<span class="post-date">11 Nov 2016</span>
<p>Nel precedente <a href="/pescewanda/2016/11/10/machine-learning-intro/">post</a> abbiamo preso in considerazione una rete neurale molto basica.
Proviamo ora ad approfondire il concetto aggiungendo una proprietá fondamentale, la memoria.</p>
<h2 id="memoria-e-stati">Memoria e Stati</h2>
<p>La rete neurale che abbiamo modellato non ha alcun tipo di memoria. con gli stessi dati di input, l&#39;output è (quasi certamente) lo stesso.
Possiamo ampliare il nostro modello introducendo il concetto di <em>stato</em>.</p>
<p>Poniamo il problema della vendita delle auto in questo modo:
immaginiamo di avere un algoritmo di machine learning che valuti le auto e faccia delle offerte di vendita che conseguentemente vengono valutate da delle persone e accettate oppure rifiutate.
Ogni volta che una proposta viene accettata la teniamo in memoria e nell&#39;aggiustare i pesi per la seguente offerta, teniamo in considerazione la validità dei pesi usati in precedenza.
In altre parloe, in ogni operazione di valutazione dell&#39;auto salviamo lo stato dell&#39;offerta precedente (rifiutata o accettata) e la consideriamo quando vogliamo proporre l&#39;offerta successiva.
Abbiamo in questo modo una <em>recurrent neural network</em> (RNN) dove ogni stato precedente viene utilizzato per modificare l&#39;output dell&#39;algoritmo.</p>
<h4 id="generazione-di-testo-attraverso-le-rnn">Generazione di testo attraverso le RNN</h4>
<p>Immaginiamo di voler creare un algoritmo che utilizzando una RNN possa generare del testo o prevedere quale sarà il prossimo carattere inserito (come nel caso del T9).</p>
<p>Inizialmente dobbiamo permettere alla RNN di analizzare almeno qualche sample del nostro testo.
La RNN analizza carattere dopo carattere e costruisce un grande grafo dove collega ogni carattere al suo successivo.
Inizialmente l&#39;output della nostra RNN non ha alcun valore:
in questo esempio, abbiamo l&#39;output di una RNN allenata attraverso Guerra e Pace:</p>
<div class="highlight"><pre><code class="language-" data-lang="">tyntd-iafhatawiaoihrdemot lytdws e ,tfti, astai f ogoh eoase rrranbyne 'nhthnee e
plia tklrgd t o idoe ns,smtt h ne etie h,hregtrs nigtike,aoaenns lngty
</code></pre></div>
<p>L&#39;output prodotto dalla RNN, benchè non abbia nessun valore per un umano, viene analizzato dalla RNN per arricchire il grafo costituito inizialmente dai caratteri (e le loro relazioni) di Guerra e Pace.
Questo procedimento continua all&#39;infinito.
Ogni volta che la RNN produce dell&#39;output lo salva e lo riutilizza come input in maniera ricorsiva per generare nuovo output.</p>
<p>Dopo 300 iterazioni abbiamo un output di questo tipo:</p>
<div class="highlight"><pre><code class="language-" data-lang="">"Tmont thithey" fomesscerliund
Keushey. Thom here
sheulke, anmerenith ol sivh I lalterthend Bleipile shuwy fil on aseterlome
coaniogennc Phe lism thond hon at. MeiDimorotion in ther thize."
</code></pre></div>
<p>Dopo quasi mille:</p>
<div class="highlight"><pre><code class="language-" data-lang="">Aftair fall unsuch that the hall for Prince Velzonski's that me of
her hearly, and behs to so arwage fiving were to it beloge, pavu say falling misfort
how, and Gogition is so overelical and ofter.
</code></pre></div>
<p>Duemila:</p>
<div class="highlight"><pre><code class="language-" data-lang="">"Why do what that day," replied Natasha, and wishing to himself the fact the
princess, Princess Mary was easier, fed in had oftened him.
Pierre aking his soul came to the packs and drove up his father-in-law women.
</code></pre></div>
<p>Possiamo notare come l&#39;output migliori visibilmente.</p>
<p>Nel prossimo post tratterò una variante di rete neurale utilizzata per classificare e riconoscere immagini.</p>
</div>
<div class="post">
<h1 class="post-title">
<a href="/pescewanda/2016/11/10/machine-learning-intro/">
Capire il Machine Learning (parte 1)
</a>
</h1>
<span class="post-date">10 Nov 2016</span>
<p>Questo è il primo di una serie di post che hanno l&#39;obbiettivo di fornire una breve e generale introduzione al mondo del machine learning e delle intelligenze artificiali piú in generale.
Mi auguro che questa breve introduzione al mondo dell&#39;apprendimento automatico sia una sorta di vaccino contro il sensazionalismo mediatico e la disinformazione che negli ultimi anni fanno da contorno al progresso in questo settore.</p>
<h2 id="non-c-39-risultato-senza-algoritmo">Non c&#39;è risultato senza algoritmo</h2>
<p>Nelle scienze informatiche un algoritmo è un insieme di istruzioni che partendo da uno stato iniziale (input) permette di arrivare ad uno stato finale (output) attraverso una serie di step logici.
Ogni algoritmo utilizza una logica propria e specifica per il problema di cui si occupa.
Nel caso del machine learning l&#39;algoritmo non viene progettato in base al tipo di problema bensí vengono utilizzati algoritmi generici adattabili attraverso dei parametri.
L&#39;algoritmo di machine learning analizza i vari parametri e i dati che riceve &quot;in pasto&quot; al fine di raggiungere lo stato di output ottimale.
L&#39;output ottimale è la migliore approssimazione di un risultato teorico che si raggiunge nella fase di &quot;training&quot;.</p>
<h2 id="la-macchina-impara">La macchina impara</h2>
<p>Nella fase di allenamento o di apprendimento, il &quot;training&quot;, si possono adottare due tecniche differenti: apprendimento con supervisione ( <strong>supervised learning</strong> ) e apprendimento senza supervisione ( <strong>unsupervised learning</strong> ).</p>
<h4 id="supervised-learning">Supervised Learning</h4>
<p>Immaginiamo di dover valutare il prezzo di un&#39;automobile usata senza essere esperti in materia.
Noi abbiamo questi dati:</p>
<table><thead>
<tr>
<th>PREZZO ORIGINALE</th>
<th style="text-align: center">Km percorsi</th>
<th style="text-align: center">stato di usura</th>
<th style="text-align: right">PREZZO FINALE</th>
</tr>
</thead><tbody>
<tr>
<td>50 000</td>
<td style="text-align: center">120 000</td>
<td style="text-align: center">lieve</td>
<td style="text-align: right">40 000</td>
</tr>
<tr>
<td>30 000</td>
<td style="text-align: center">150 000</td>
<td style="text-align: center">notevole</td>
<td style="text-align: right">8 000</td>
</tr>
<tr>
<td>20 000</td>
<td style="text-align: center">80 000</td>
<td style="text-align: center">lieve</td>
<td style="text-align: right">15 000</td>
</tr>
<tr>
<td>20 000</td>
<td style="text-align: center">120 000</td>
<td style="text-align: center">notevole</td>
<td style="text-align: right">...</td>
</tr>
</tbody></table>
<p>Dalla tabella possiamo dedurre la caratteristica fondamentale del <strong>supervised learning</strong>: abbiamo due vettori (serie di dati) di input (prezzo originale) e di output (prezzo finale) che hanno una correlazione certa e valida.</p>
<p>Possiamo dedurre intuitivamente quale sarà il prezzo dell&#39;ultima auto se analizziamo i dati precedenti.
Questo è quello che succede nel caso del <strong>supervised learning</strong>.
Un algoritmo di machine learning che utilizza il <strong>supervised learning</strong> estrapolerà la relazione fra i vari dati e in questo modo potrà ottenere un determinato output partendo dai dati di input.
Possiamo capire già da ora che nel caso ci fossero dati che &quot;inquinano&quot; il nostro data set, come ad esempio il colore dell&#39;auto, l&#39;algoritmo non sarà capace di fare un&#39;analisi corretta.</p>
<p>La precisione della soluzione dipende dalla quantità di dati e dall&#39;influenza che questi hanno nella situazione reale.</p>
<h1 id="unsupervised-learning">Unsupervised Learning</h1>
<p>Nel caso di unsupervised learning ci troviamo di fronte agli stessi dati ma senza la possibilità di conoscere il prezzo finale.</p>
<table><thead>
<tr>
<th>PREZZO ORIGINALE</th>
<th style="text-align: center">Km percorsi</th>
<th style="text-align: right">stato di usura</th>
</tr>
</thead><tbody>
<tr>
<td>50 000</td>
<td style="text-align: center">120 000</td>
<td style="text-align: right">lieve</td>
</tr>
<tr>
<td>30 000</td>
<td style="text-align: center">150 000</td>
<td style="text-align: right">notevole</td>
</tr>
<tr>
<td>20 000</td>
<td style="text-align: center">80 000</td>
<td style="text-align: right">lieve</td>
</tr>
<tr>
<td>20 000</td>
<td style="text-align: center">120 000</td>
<td style="text-align: right">notevole</td>
</tr>
</tbody></table>
<p>Non siamo capaci di stabilire il prezzo finale attraverso l&#39;unsupervised learning, ma possiamo stabilire dei pattern fra i vari dati.
Non c&#39;è nessun tipo di feedback (il prezzo finale) che possa aiutarci a capire se il risultato sia giusto ma possiamo analizzare le notevoli relazioni fra i dati.</p>
<h1 id="machine-learning-e-intelligenza">Machine Learning e intelligenza</h1>
<p>Concentriamoci sul <strong>supervised learning</strong>.
Nel caso della vendita dell&#39;automobile, abbiamo un semplice problema con una soluzione lineare di questo tipo:
<em>prezzo finale</em> = <em>prezzo originale</em> + <em>km percorsi</em> + stato di usura</p>
<p>Ovviamente ogni incognita nella nostra equazione influisce diversamente sul prezzo finale e quindi possiamo riscriverla come:
<em>prezzo finale</em> = A *<em>prezzo originale</em> + B *<em>km percorsi</em> + C * stato di usura</p>
<p>Se pensiamo ad un algoritmo possiamo ragionare in questo modo:</p>
<div class="highlight"><pre><code class="language-" data-lang="">funzione: calcola_prezzo_auto:
parametri: prezzo_originale, km_percorsi, stato_usura
variabili: prezzo_finale = 0
prezzo finale = prezzo_originale * 0.804246
prezzo finale = prezzo_finale + km_percorsi * -0.000125
prezzo finale = prezzo_finale + stato_usura * -2500
</code></pre></div>
<p>I valori di quelle costanti, stabilite casualmente nell&#39;esempio, sono chiamate <em>pesi</em> e servono a stimare il prezzo finale.
Una volta stabiliti i pesi, il nostro algoritmo di supervised learning applica questi pesi ai dati originali e ne valuta l&#39;errore:</p>
<table><thead>
<tr>
<th>PREZZO ORIGINALE</th>
<th style="text-align: center">Km percorsi</th>
<th style="text-align: center">stato di usura</th>
<th style="text-align: center">PREZZO FINALE</th>
<th style="text-align: right">PREZZO STIMATO</th>
</tr>
</thead><tbody>
<tr>
<td>50 000</td>
<td style="text-align: center">120 000</td>
<td style="text-align: center">lieve</td>
<td style="text-align: center">40 000</td>
<td style="text-align: right">374888</td>
</tr>
<tr>
<td>30 000</td>
<td style="text-align: center">150 000</td>
<td style="text-align: center">notevole</td>
<td style="text-align: center">8 000</td>
<td style="text-align: right">16000</td>
</tr>
<tr>
<td>20 000</td>
<td style="text-align: center">80 000</td>
<td style="text-align: center">lieve</td>
<td style="text-align: center">15 000</td>
<td style="text-align: right">13492</td>
</tr>
<tr>
<td>20 000</td>
<td style="text-align: center">120 000</td>
<td style="text-align: center">notevole</td>
<td style="text-align: center">...</td>
<td style="text-align: right">10988</td>
</tr>
</tbody></table>
<p>Una volta valutato l&#39;errore e la distanza dal prezzo finale, l&#39;algoritmo di machine learning modifica i pesi di conseguenza e ripete la procedura fino ad arrivare al risultato che piú si avvicina ai dati iniziali.
<img src="/wp-content/uploads/2016/reteneurale1.jpg" alt="rete1">
Ci sono varie funzioni che stimano l&#39;errore e permettono di correggere i pesi o metodi che restringono lo spazio di ricerca fino a convergere alla soluzione, ovvero i pesi cercati.</p>
<h2 id="reti-neurali">Reti Neurali</h2>
<p>Ora, come possiamo immaginare, il prezzo di un&#39;auto ha molti fattori che si aggiungono a quelli elencati nell&#39;esempio.
Non solo, ma molti problemi non hanno una soluzione lineare, ovvero una soluzione che si puó semplicemente esprimere attraverso una funzione che aggiunge e moltiplica i valori una sola volta.</p>
<p>Possiamo arricchire l&#39;esempio dell&#39;automobile immaginando di avere più set di pesi e di ripetere il procedimento più volte:</p>
<div class="highlight"><pre><code class="language-" data-lang="">|---------------------------------------------------|
| PREZZO_ORIG * peso A1 -----&gt; |
| KM_PERCORSI * peso B1 -----&gt; |
| STATO_USURA * peso C1 -----&gt; |
| PREZZO FINALE STIMATO 1|
|---------------------------------------------------|
| --------------------------------------------------|
| PREZZO_ORIG * peso A2 -----&gt; |
| KM_PERCORSI * peso B2 -----&gt; |
| STATO_USURA * peso C2 -----&gt; |
| PREZZO FINALE STIMATO 2|
|---------------------------------------------------|
| --------------------------------------------------|
| PREZZO_ORIG * peso A3 -----&gt; |
| KM_PERCORSI * peso B3 -----&gt; |
| STATO_USURA * peso C3 -----&gt; |
| PREZZO FINALE STIMATO 3|
|---------------------------------------------------|
</code></pre></div>
<p>E ora immaginiamo di combinare ogni PREZZO FINALE STIMATO in un&#39;ultimo risultato:</p>
<div class="highlight"><pre><code class="language-" data-lang="">| --------------------------------------------------|
| PREZZO_1 * peso X -----&gt; |
| PREZZO_2 * peso Y -----&gt; |
| PREZZO_3 * peso Z -----&gt; |
| PREZZO FINALE DEF |
|---------------------------------------------------|
</code></pre></div>
<p>Questa é, seppur molto basica, una rete neurale.
Proviamo a visualizzarla in un&#39;immagine dove i box arancioni sono i nodi di input e i rossi sono i nodi &quot;nascosti&quot; e temporanei.</p>
<p><img src="/wp-content/uploads/2016/reteneurale2.jpg" alt="rete2"></p>
<p>In una rete neurale (<em>neural networks</em>) abbiamo:</p>
<ul>
<li><p>i neuroni: la funzione di stima e i set di pesi;</p></li>
<li><p>le catene: i collegamenti fra neuroni che permettono di valutare il prezzo più volte.</p></li>
</ul>
<p>Nel prossimo <a href="/pescewanda/2016/11/11/machine-learning-PARTE2">post</a> cercherò di approfondire il concetto di rete neurale con degli esempi di applicazioni concrete.</p>
</div>
<div class="post">
<h1 class="post-title">
<a href="/pescewanda/2016/07/07/pres-berk/">
A short talk about cryptography at the Berkman Klein Center
</a>
</h1>
<span class="post-date">07 Jul 2016</span>
<p>The 7th of July me and <a href="http://studentprivacy.ca">Aaron</a>, as interns at the <a href="http://cyber.law.harvard.edu">Berkman Klein for Internet and Society</a>, gave a presentation on the basics of cryptography and a quick overview on the essential tools.</p>
<p>What follows is a short summary of that presentation. The slides are available <a href="/wp-content/uploads/2016/fwneas.pptx">here</a></p>
<h3 id="whose-security">Whose Security?</h3>
<p>Let&#39;s define what security is. Security is the possibility to being set free from structural costraints, and as that we can distinguish various levels of security depending on who we are.</p>
<p>Also, if we want to investigate security we should also define our threats: security, as being set free, from intelligence surveillance can be our target. Our concerns as different if we consider instead security from censorship or corporation data mining.</p>
<p><img src="/wp-content/uploads/2016/godmode.png" alt="uber god view">
<img src="/wp-content/uploads/2016/fb.png" alt="facebook law enforcement form"></p>
<p>What is shown above is the <a href="http://www.theverge.com/2016/1/6/10726004/uber-god-mode-settlement-fine">Uber God View</a>, a tool Uber used to track a Buzzfeed&#39;s journalist locations, and the Facebook standard form that is given to law enforcement when requested.</p>
<h3 id="security-is-a-state-of-mind">Security is a state of mind</h3>
<p>Security is hard. It is really rare to reach a state of complete security and even in that case, it depends on our target.</p>
<p>What is important is to train ourselves to security. Security is a state of mind and there are no tools that automatically protect us without our active partecipation.</p>
<p>Let&#39;s explore that in details.</p>
<h3 id="the-layers-of-security">The layers of security</h3>
<p>We can distinguish four layers of security:</p>
<ul>
<li>Device Security</li>
<li>Network Security</li>
<li>Message Security</li>
<li>Human Security</li>
</ul>
<h6 id="device-security-where-everything-happens">Device Security, where everything happens</h6>
<p>Device security is related to the &quot;physical host&quot;.</p>
<p>If the computer we use is tampered, at the hardware level, or the phone is bugged, there is no way to escape using higher level tools.</p>
<p>In other words, it doesn&#39;t matter if we use a super secure password if our computer is registering all our keystrokes and send them to a third party.</p>
<p>Also, device security is useful if we consider that our device can fall into the hands of attackers that may be able to traceback all the activities.</p>
<p>Some precautions for this purpose:</p>
<ul>
<li>full disk encryption</li>
<li>minimal set of application installed</li>
<li>open source operating systems</li>
</ul>
<h6 id="network-security">Network Security</h6>
<p>The network is the infrastructures that our device is attached to. In most of the case, when we consider our computer is the internet (and the GSM network in case of mobile phones).</p>
<p>Network security is essential to evade censorship, behavioural tracking and identity theft.</p>
<p>Some tools that may help in this case:</p>
<ul>
<li>vpn</li>
<li>tor</li>
<li>p2p networks</li>
<li>mesh networks</li>
</ul>
<p>And for the web:</p>
<ul>
<li>opensource web browsers (such as firefox)</li>
<li>no google apps on android phones</li>
<li>https</li>
</ul>
<h6 id="message-security">Message Security</h6>
<p>Message security is the level of protection regarding the content that you want to send or receive.</p>
<p>Message security is essential if you want to avoid any third party snooping and the confidentiality of your messages.</p>
<p>The tools we can use in this context:</p>
<ul>
<li>OTR</li>
<li>opensource messaging protocols (XMPP, matrix)</li>
<li>Signal</li>
<li>PGP</li>
</ul>
<p>Also, always remember that encrypting the content of the message doesn&#39;t guarantee that your identity and the metadata are hidden.</p>
<h6 id="human-security-the-weakest-link">Human Security, the weakest link</h6>
<p>Everything comes down to the human level at a certain point.</p>
<p>This is way it is important to train ourselves in security.</p>
<p>If we consider <a href="https://en.wikipedia.org/wiki/Kevin_Mitnick">Kevin Mitnick&#39;s history</a>, or the recent <a href="http://thehackernews.com/2015/11/fbi-cia-director-hack.html">FBI deputy director hack</a> we see that social engineering plays a big role when we want to undermine the security of an individual of interest.</p>
<p>But security matters even if we are not target of interest.</p>
<p>For example let&#39;s consider our password. If we use the same password on every site and one cracker manages to gain access to just one of them, our whole activities online can be exposed and our identity stolen. <a href="http://www.nydailynews.com/news/national/mark-zuckerberg-twitter-account-hacked-password-dadada-article-1.2662351">This is relevant</a>. Myspace had its database breached and the password of Zuckerberg (even a simple one) was exposed. Given that he used the same password on twitter and other sites, his multiple accounts were compromised.</p>
<h3 id="what-is-tor-and-how-it-works">What is TOR and how it works</h3>
<p>When you visit a website with your mobile phone or a browser on your computer lots of things go on under the hoods.</p>
<p>Your computer, as a client, makes what is called an <a href="https://en.wikipedia.org/wiki/Transmission_Control_Protocol#Connection_establishment">handshake</a> with the server.</p>
<p>After telling the server that the client is interested in its content, a series of packets containing data is exchanged.</p>
<p>That is the content of a connection. Inside this packets there are a multitude of information of two kinds:</p>
<ul>
<li>the web page or the content we are trying to visualize</li>
<li>information on the status of both the server and the client</li>
</ul>
<p>The informations contained in every packet can be analized to understand the &quot;identity&quot; of the client that is requesting the content on the server, first of all the IP that is a sort of web address that every computer on the net has.</p>
<p>Not only, during the transmission of this packets, various entity on the communication channel can analize the content and mine our data.</p>
<p><img src="/wp-content/uploads/2016/tor-https-0.png" alt="Cute infographic"></p>
<p>TOR still uses this kind of routine to gather the content of a web page, but instead of connecting directly to the destination server it goes through a series of other servers called relay: instead of going directly from A to B, it goes from A to C to D to E to F to B.</p>
<p>If the web was a kindergarden Alice instead of telling directly her phrase to Bob, she would tell the word to a friend that in turn would tell the word to a friend and so on, until Bob heards the word, without knowing that Alice said that at the beginning.</p>
<p>At this point you should ask yourself: are the data more protected if it goes through a network of relays? It actually is given that every time you send a packet through the TOR network, it gets encrypted so that no one knows it&#39;s content.</p>
<p>To tell the truth, actually the relay (called exit node) that will send the packet to the destination server, knows the content of the packet but does not know the origin.</p>
<p>Ultimately a website can be entirely hosted on the TOR network, called the onion network, so that the packets never exit from the relays and the relay don&#39;t know the phisycal location of the server, so every entity on the network reach a perfect level of anonimacy.</p>
<h3 id="who-owns-the-relays">Who owns the relays?</h3>
<p>Actually every one can host and own a relay if they are willing to do so.
I personally host one right now and there are many others that share a little fraction of their network connection.</p>
<p><img src="/wp-content/uploads/2016/screenraspy.png" alt="My little raspi is moving some packets right now"></p>
<p>Running a relay node is very easy and everybody should do so. Running an exit node instead is more troublesome and I don&#39;t suggest it if you are not a big entity that can handle some sorts of occasional trouble.</p>
<h3 id="don-39-t-play-the-fool-on-the-tor-network">Don&#39;t play the fool on the TOR network</h3>
<p>Of course TOR doesn&#39;t guarantee you perfect anonimacy. At the end it all comes to the human layer.</p>
<p>It&#39;s no use to surf the web through TOR if we then log in to our personal blog or our personal facebook page.</p>
<p>But there are other subtle factors that can be exploited by web companies to gather info and track their users.A</p>
<p>Such factors are:</p>
<ul>
<li>the size of the screen and the colors supported by it</li>
<li>the timezone</li>
<li>canvas and images that the server asks your computer to generate</li>
<li>information about your OS that are sent through packets</li>
<li>the fonts available on your system</li>
<li>touch support</li>
<li>cookies</li>
<li>ads and cross site requests</li>
</ul>
<p>In particular, most of these are exploitable using a web programming language, javascript, that lots of web pages uses to render content. TOR users should avoid the use of javascript.</p>
<h3 id="public-private-key-encryption">Public Private Key Encryption</h3>
<p>While TOR is recent technology, public key encryption is a concept way older.</p>
<p>What happens when we use public / private key encryption tools is conceptually similar to what happens with our physical correspondence.</p>
<p>A public key is similar to our mailbox.</p>
<p>Everyone that knows the location of a person&#39;s mailbox can write a message and put it inside but only the owner of that mailbox, using is own key can open the mailbox and read the various messages.</p>
<p>When we use PGP or GPG (an implementation of the public key encription concept) we generate a pair of key.</p>
<p>A public one that we should broadcast or at least share with our social circle, and a private key that must remain secret at any cost.</p>
<p>Everyone can encrypt every kind of digital content using our public key (that is just a really long string) and only the owner of the private key can proceed to decryption of the content.</p>
<p>This also means that we know who is gonna read the message if encrypted using this kind of technologies.</p>
<p>One easy tool for GPG encryption is <a href="https://www.gnupg.org/%28en%29/related_software/gpa/index.html">GPA</a></p>
<h3 id="metadata">Metadata</h3>
<p>What would you do if you were asked to put under surveillance one person?</p>
<p>For sure placing a bug with microphone and recording capabilities would be the best option.</p>
<p>But what if, instead of recording every thing the subject does, we just take a note of all his actions, without taking care of the content. For example, if the subject speaks to someone, we record the time, the place, the duration of the conversation and all the info of the person he is talking with.
What if, when the person walks into a mall, we record the time, the location, the shops he entered, the money he spent, the number of things bought, but not the things he bought, in detail.</p>
<p>You can see that you can have a fairly precise idea of the habits of the person under your surveillance.</p>
<p>Actually from metadata is easy to grab all kinds of personal information. Also, if a tiny portions of the information we have on the subject are more detailed (for example social network photos) we have a picture as clear as never.</p>
<p>This is not just one of the biggest concern that should pop into your mind when you are talking about nation wide mass surveillance, it is also the core of the business of corporations like Facebook and Google.</p>
<p>Whatsapp does not read the content of your messages but it stores every single bit of metadata that comes with it.</p>
<p>Metadatas are enought to build a complete profile of the users and they are even more dangerous in the hands of an evil state agency.</p>
<h3 id="nothing-to-hide">Nothing to hide</h3>
<p>Even if we have nothing to hide, we have much to fear.</p>
<p>The &quot;nothing to hide&quot; argument is something that everyone of us in this room has heard, at least one time.</p>
<p>We should fear this sentence because it is the ultimate ammision of a big misunderstanding on the whole debate.</p>
<p>Privacy, first of all, is <strong>control</strong> over our data, not only the right to secrecy.</p>
<h6 id="transparency-should-be-for-everyone">Transparency should be for everyone</h6>
<p>There is a big incoherence when asking to your citizens to handle over their data. </p>
<p>Transparency should be a two way thing, while at the current state big three letter agencies, but high level people as well, cover their tracks and are not transparent on their reports. </p>
<p>This enhance a situation of big inequality between the people and the State.</p>
<p>Even worse, it is not the citizen by himself that can choose if he has something to hide, but the autority.</p>
<p>This may seem a little naive to say, but with Bruce words:</p>
<blockquote>
<p>If you give me six lines written by the hand of the most honest of men, I will find something in them which will hang him.</p>
</blockquote>
<p>This is true even without considering social discrimination and mass media manipolation.</p>
<h6 id="the-fundamental-of-society">The fundamental of society</h6>
<p>Every action can be seen as either legal or illegal. When we take a decision this is one of the first, implicit concern.</p>
<p>This is not true in a surveillance system: when you are doing something your concern is all about the possibility of raising suspicion.</p>
<p>An idea not an action is what is needed in such a dystopic condition to prove a citizen guilty.</p>
<h6 id="sometimes-two-wrongs-make-a-right">Sometimes two wrongs make a right</h6>
<p>In America we are now discussing weed legalization.</p>
<p>Do you think that such debate would have been possible if no one could had the possibility, even if against the law, to try that substance and show other citizen the real implications of their actions?</p>
<p>The same goes for gay marriages, that we are discussing in Italy. Challenging the law, breaking it if needed, is a way to improve the current system.</p>
<p>Inside the panopticon every <strong>potential</strong> criminal would be persecuted and this kind of advancement would not be possible.</p>
<h3 id="to-hide-is-to-care">To hide is to care</h3>
<p>A simple truth is that we don&#39;t close the windows to cover up our crimes. </p>
<p>Our innermost experiences become in our intimacy, which is the most sacred place.</p>
</div>
</div>
<div class="pagination">
<a class="pagination-item older" href="/page2">Older</a>
<span class="pagination-item newer">Newer</span>
</div>
</div>
<!--<link rel="alternate" type="application/rss+xml" title="Francesco Mecca RSS" href="/feed.xml">-->
</body>
</html>