diff --git a/.obsidian/plugins/mathlive-in-editor-mode/data.json b/.obsidian/plugins/mathlive-in-editor-mode/data.json index b3390fa..34539d0 100644 --- a/.obsidian/plugins/mathlive-in-editor-mode/data.json +++ b/.obsidian/plugins/mathlive-in-editor-mode/data.json @@ -1,15 +1,8 @@ { -<<<<<<< HEAD "display": false, - "blockDisplay": false, - "blockMenuIcon": false, - "blockKeyboardIcon": false, -======= - "display": true, "blockDisplay": true, "blockMenuIcon": true, "blockKeyboardIcon": true, ->>>>>>> origin/main "inlineDisplay": false, "inlineMenuIcon": false, "inlineKeyboardIcon": false diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 45c9332..bf5e150 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -57,16 +57,30 @@ "state": { "type": "markdown", "state": { - "file": "Autonomous Networking/notes/6.1 RL.md", + "file": "Autonomous Networking/notes/4 WSN Routing.md", "mode": "source", "source": false }, "icon": "lucide-file", - "title": "6.1 RL" + "title": "4 WSN Routing" + } + }, + { + "id": "0bf9b49092a69d2b", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "conflict-files-obsidian-git.md", + "mode": "source", + "source": false + }, + "icon": "lucide-file", + "title": "conflict-files-obsidian-git" } } ], - "currentTab": 3 + "currentTab": 4 } ], "direction": "vertical" @@ -222,9 +236,25 @@ "obsidian-git:Open Git source control": false } }, - "active": "ecb69e773963ff71", + "active": "0bf9b49092a69d2b", "lastOpenFiles": [ "Autonomous Networking/notes/4 WSN Routing.md", + "conflict-files-obsidian-git.md", + "Autonomous Networking/notes/6.1 RL.md", + "Pasted image 20241024100002.png", + "Pasted image 20241024095704.png", + "Pasted image 20241024094223.png", + "Pasted image 20241024093000.png", + "Pasted image 20241024092903.png", + "Pasted image 20241024092146.png", + "Pasted image 20241024091511.png", + "Pasted image 20241024091446.png", + "Pasted image 20241024091433.png", + "Pasted image 20241024091235.png", + "Biometric Systems/slides/LEZIONE5_NEW_More about face localization.pdf", + "Autonomous Networking/slides/7 RL1.pdf", + "Autonomous Networking/slides/6 IoT.pdf", + "Autonomous Networking/notes/7 RL.md", "Autonomous Networking/slides/3 WSN.pdf", "Autonomous Networking/slides/4 WSN2.pdf", "Autonomous Networking/notes/6 Internet of Things.md", @@ -232,32 +262,17 @@ "Autonomous Networking/notes/3 WSN MAC.md", "Autonomous Networking/notes/2 RFID.md", "Autonomous Networking/notes/5 Drones.md", - "Autonomous Networking/notes/6.1 RL.md", - "conflict-files-obsidian-git.md", "Biometric Systems/slides/LEZIONE4_Face introduction and localization.pdf", "Biometric Systems/notes/4. Face recognition.md", - "Biometric Systems/images/Pasted image 20241017083943.png", - "Biometric Systems/images/Pasted image 20241017083506.png", - "Biometric Systems/images/Pasted image 20241017083255.png", "Autonomous Networking/slides/5 Drones.pdf", - "Autonomous Networking/images/Pasted image 20241017161803.png", - "Autonomous Networking/images/Pasted image 20241017161747.png", - "Autonomous Networking/images/Pasted image 20241017161744.png", - "Autonomous Networking/images/Pasted image 20241017161724.png", - "Autonomous Networking/images/Pasted image 20241017154152.png", "Foundation of data science/slides/Untitled.md", "Biometric Systems/slides/LEZIONE3_Affidabilita_del_riconoscimento.pdf", "Biometric Systems/notes/3. Recognition Reliability.md", - "Biometric Systems/images/Pasted image 20241016174417.png", - "Biometric Systems/images/Pasted image 20241016174411.png", "Foundation of data science/notes/1 CV Basics.md", "Foundation of data science/slides/IP CV Basics.pdf", "Foundation of data science/slides/notes 2.md", "Biometric Systems/notes/2. Performance indexes.md", - "Foundation of data science/notes", - "Biometric Systems/slides/LEZIONE2_Indici_di_prestazione.pdf", "Biometric Systems/notes/1. Introduction.md", - "Foundation of data science/slides/FDS_intro_new.pdf", "BUCA/Queues.md", "Biometric Systems/slides/lezione1 notes.md", "prova per obsidian.md", diff --git a/Autonomous Networking/notes/6 Internet of Things.md b/Autonomous Networking/notes/6 Internet of Things.md index 419e9ce..4fb5850 100644 --- a/Autonomous Networking/notes/6 Internet of Things.md +++ b/Autonomous Networking/notes/6 Internet of Things.md @@ -1,7 +1,7 @@ IoT term is used to refer to - the resulting globlal network of connecting smart objects -- the protocols ... -- ... +- technologies needed to realize such a vision +- applications and services leveraging such technologies required features: - devices hetereogeneity @@ -9,6 +9,11 @@ required features: - data ubiquitous data exchange - energy-optimized solutions +key features: +- localization and tracking (many applications require position and movement tracking) +- self-organization capabilities (support ad-hoc networks) +- semantic interoperability (standard formats for data) +- embedded security and privacy-preserving mechanism #### Backscattering - allows devices to run without battery @@ -16,7 +21,7 @@ required features: - use radio frequency signals as power source - two types - ambient - - rfid + - RFID ##### Ambient backscattering - devices harvest power from signals available in the environment @@ -29,13 +34,12 @@ required features: - signal may not be available indoor or not powerful enough ##### RFID backscattering - -... - +- main advantage is the availability of RFID signal. Reader is always present in a RFID ##### Battery free smart home - in a smart home there may be a lot of smart devices - if every one of them has a battery, it's not good for the environment - we can deploy an RFID reader with multiple antennas that covers all the different rooms +- of course RFID sensors can have very low capabilities, but they can run sensors! ### Communication add scheme slide diff --git a/Autonomous Networking/notes/6.1 RL.md b/Autonomous Networking/notes/6.1 RL.md deleted file mode 100644 index 5889544..0000000 --- a/Autonomous Networking/notes/6.1 RL.md +++ /dev/null @@ -1,122 +0,0 @@ -Case study: battery-free smart home -- each device produces a new data sample with a rate that depends on the environment and the user (continuously, event based / on demand...) -- a device should only transmit when it has new data - - but in backscattering-based networks they need to be queried by the receiver - -In which order should the reader query tags? -- assume prefixed timeslots -- TDMA with random access performs poorly -- TDMA with fixed assignment also does (wasted queries) -- we want to query devices that have new data samples and avoid - - data loss - - redundant queries - -Goal: design a mac protocol that adapts to all of this. -One possibility is to use Reinforcement Learning - -#### Reinforcement learning -How can an intelligent agent learns to make a good sequence of decisions - -- an agent can figure out how the world works by trying things and see what happens -- is what people and animals do -- we explore a computational approach to learning from interaction - - goal-directed learning from interaction - -RL is learning what to do, it presents two main characteristics: -- trial and error search -- delayed reward - -- sensation, action and goal are the 3 main aspects of a reinforcement learning method -- a learning agents must be able to - - sense the state of the environment - - take actions that affects the state - -Difference from other ML -- no supervisor -- feedback may be delayed -- time matters -- agent action affects future decisions -- ... -- online learning - -Learning online -- learning while interacting with an ever changing world -- we expect agents to get things wrong, to refine their understanding as they go -- the world is not static, agents continuously encounter new situations - -RL applications: -- self driving cars -- engineering -- healthcare -- news recommendation -- ... - -Rewards -- a reward is a scalar feedback signal (a number) -- reward Rt indicates how well the agent is doing at step t -- the agent should maximize cumulative reward - -RL based on the reward hypotesis -all goals can be described by the maximization of expected cumulative rewards - -communication in battery free environments -- positive rewards if the queried device has new data -- else negative - -Challenge: -- tradeoff between exploration and exploitation -- to obtain a lot of reward a RL agent must prefer action that it tried and ... -- ... - -exploration vs exploitation dilemma: -- comes from incomplete information: we need to gather enough information to make best overall decisions while keeping the risk under control -- exploitation: we take advanced of the best option we know -- exploration: test new decisions - -### A general RL framework -at each timestamp the agent -- executes action -- receives observation -- receives scalar reward - -the environment -... - -agent state: the view of the agent on the environment state, is a function of history -- the function of the history is involved in taking the next decision -- the state representation defines what happens next -- ... - -#### Inside the agent -one or more of these components -- **Policy:** agent's behavior function - - defines what to do (behavior at a given time) - - maps state to action - - core of the RL agent - - the policy is altered based on the reward - - may be - - deterministic: single function of the state - - stochastic: specifying probabilities for each actions - - reward changes probabilities -- **Value function:** - - specifies what's good in the long run - - is a prediction of future reward - - used to evaluate the goodness/badness of states - - values are prediction of rewards - - Vp(s) = Ep[yRt+1 + y^2Rt+2 ... | St = s] -- **Model:** - - predicts what the environment will do next - - many problems are model free - -back to the original problem: -- n devices -- each devices produces new data with rate_i -- in which order should the reader query tags? -- formulate as an RL problem - - agent is the reder - - one action per device (query) - - rewards: - - positive when querying a device with new data - - negative if it has no data - - what to do if the device has lost data? - - state? \ No newline at end of file diff --git a/Autonomous Networking/notes/7 RL.md b/Autonomous Networking/notes/7 RL.md new file mode 100644 index 0000000..606f7a2 --- /dev/null +++ b/Autonomous Networking/notes/7 RL.md @@ -0,0 +1,225 @@ +Case study: battery-free smart home +- each device produces a new data sample with a rate that depends on the environment and the user (continuously, event based / on demand...) +- a device should only transmit when it has new data + - but in backscattering-based networks they need to be queried by the receiver + +In which order should the reader query tags? +- assume prefixed time slots +- TDMA with random access performs poorly +- TDMA with fixed assignment also does (wasted queries) +- we want to query devices that have new data samples and avoid + - data loss + - redundant queries + +Goal: design a mac protocol that adapts to all of this. +One possibility is to use Reinforcement Learning + +#### Reinforcement learning +How can an intelligent agent learns to make a good sequence of decisions + +- an agent can figure out how the world works by trying things and see what happens +- is what people and animals do +- we explore a computational approach to learning from interaction + - goal-directed learning from interaction + +RL is learning what to do, it presents two main characteristics: +- trial and error search +- delayed reward + +- sensation, action and goal are the 3 main aspects of a reinforcement learning method +- a learning agents must be able to + - sense the state of the environment + - take actions that affects the state + +Difference from other ML +- no supervisor +- feedback may be delayed +- time matters +- agent action affects future decisions +- a sequence of successful decisions will result in the process being reinforced +- RL learns online + +Learning online +- learning while interacting with an ever changing world +- we expect agents to get things wrong, to refine their understanding as they go +- the world is not static, agents continuously encounter new situations + +RL applications: +- self driving cars +- engineering +- healthcare +- news recommendation +- ... + +Rewards +- a reward is a scalar feedback signal (a number) +- reward Rt indicates how well the agent is doing at step t +- the agent should maximize cumulative reward + +RL based on the reward hypotesis +all goals can be described by the maximization of expected cumulative rewards + +communication in battery free environments +- positive rewards if the queried device has new data +- else negative + +Challenge: +- tradeoff between exploration and exploitation +- to obtain a lot of reward a RL agent must prefer action that it tried in the past +- but better actions may exist... So the agent has to exploit! + +exploration vs exploitation dilemma: +- comes from incomplete information: we need to gather enough information to make best overall decisions while keeping the risk under control +- exploitation: we take advanced of the best option we know +- exploration: test new decisions + +### A general RL framework +**at each timestamp the agent:** +- executes action At +- receives observation Ot +- receives scalar reward Rt + +**the environment:** +- receives action At +- emits observation Ot +- emits scalar reward Rt + + + +**agent state:** the view of the agent on the environment state, is a function of history +- the function of the history is involved in taking the next decision +- the state representation defines what happens next +- ... + +#### Inside the agent +one or more of these components +- **Policy:** agent's behavior function + - defines what to do (behavior at a given time) + - maps state to action + - core of the RL agent + - the policy is altered based on the reward + - may be + - deterministic: single function of the state + - stochastic: specifying probabilities for each actions + - reward changes probabilities +- **Value function:** + - specifies what's good in the long run + - is a prediction of future reward + - used to evaluate the goodness/badness of states + - values are prediction of rewards + - Vp(s) = Ep[yRt+1 + y^2Rt+2 ... | St = s] +- **Model:** + - predicts what the environment will do next + - many problems are model free + +back to the original problem: +- n devices +- each devices produces new data with rate_i +- in which order should the reader query tags? +- formulate as an RL problem + - agent is the reder + - one action per device (query) + - rewards: + - positive when querying a device with new data + - negative if it has no data + - what to do if the device has lost data? + - state? + + +### Exploration vs exploitation trade-off +- Rewards evaluate actions taken +- evaluative feedback depends on the action taken +- no active exploration + +Let's consider a simplified version of an RL problem: K-armed bandit problem. +- K different options +- every time need to chose one +- maximize expected total reward over some time period +- analogy with slot machines + - the levers are the actions + - which level gives the highest reward? +- Formalization + - set of actions A (or "arms") + - reward function R that follows an unknown probability distributions + - only one state + - ... + +Example: doctor treatment +- doctor has 3 treatments (actions), each of them has a reward. +- for the doctor to decide which action to take is best, we must define the value of taking each action +- we call these values the action values (or action value function) +- action value: ... + +Each action has a reward defined by a probability distribution. +- the red treatment has a bernoulli probability +- the yellow treatment binomial +- the blue uniform +- the agent does not know the distributions! +- the estimated action for action a is the sum of rewards observed divided by the total time the action has been taken (add formula ...) + - 1predicate denotes the random variable (1 if true else 0) + +- greedy action: + - doctors assign the treatment they currently think is the best + - ... + - the greedy action is computed as the argmax of Q values + - greedy always exploits current knowledge +- epsilon-greedy: + - with a probability epsilon sometimes we explore + - 1-eps probability: we chose best greedy action + - eps probability: we chose random action + +exercises ... + +exercise 2: k-armed bandit problem. +K = 4 actions, denoted 1,2,3 and 4 +eps-greedy selection +initial Q estimantes = 0 for all a. + +Initial sequenze of actions and rewards is: +A1 = 1 R1 = 1 +A2 = 2 R2 = 2 +A3 = 2 R3 = 2 +A4 = 2 R4 = 2 +A5 = 3 R5 = 0 + +--- +step A1: action 1 selected. Q of action 1 is 1 +step A2: action 2 selected. Q(1) = 1, Q(2) = 1 +step A3: action 2 selected. Q(1) = 2, Q(2) = 1.5 +step A4: action 2. Q(1) = 1, Q(2) = 1.6 +step A5: action 3. Q(1) = 1, Q(2) = 1.6, Q(3) = 0 + +For sure A2 and A5 are epsilon cases, system didn't chose the one with highest Q value. +A3 and A4 can be both greedy and epsilon case. + +#### Incremental formula to estimate action-value +- to simplify notation we concentrate on a single action +- Ri denotes the reward received after the i(th) selection of this action. Qn denotes the estimate of its action value after it has been selected n-1 times (add Qn formula ...) +- given Qn and the reward Rn, the new average of rewards can be computed by (add formula with simplifications...) $Q_(n+1) = Q_{n} + \frac{1}{n}[Rn - Qn]$ + - NewEstimate <- OldEstimate + StepSize (Target - OldEstimate) + - Target - OldEstimate is the error + +Pseudocode for bandit algorithm: +``` +Initialize for a = 1 to k: + Q(a) = 0 + N(a) = 0 +Loop forever: + with probability 1-eps: + A = argmax_a(Q(a)) + else: + A = random action + R = bandit(A) # returns the reward of the action A + N(A) = N(A) + 1 + Q(A) = Q(A) + 1\N(A) * (R - Q(A)) +``` + +Nonstationary problem: rewards probabilities change over time. +- in the doctor example, a treatment may not be good in all conditions +- the agent (doctor) is unaware of the changes, he would like to adapt to it + +An option is to use a fixed step size. We remove the 1/n factor and add an $\alpha$ constant factor between 0 and 1. +And we get $Q_{n+1} = (1-\alpha)^{n}Q_1 + \sum_{i=1}^{n}{\alpha(1 - \alpha)^{(n-1)} R_i}$ + + +... ADD MISSING PART ... \ No newline at end of file diff --git a/Autonomous Networking/slides/6 IoT.pdf b/Autonomous Networking/slides/6 IoT.pdf new file mode 100644 index 0000000..31add08 Binary files /dev/null and b/Autonomous Networking/slides/6 IoT.pdf differ diff --git a/Autonomous Networking/slides/7 RL1.pdf b/Autonomous Networking/slides/7 RL1.pdf new file mode 100644 index 0000000..f45f82a Binary files /dev/null and b/Autonomous Networking/slides/7 RL1.pdf differ diff --git a/Biometric Systems/notes/4. Face recognition.md b/Biometric Systems/notes/4. Face recognition.md index 2dfb999..79380ec 100644 --- a/Biometric Systems/notes/4. Face recognition.md +++ b/Biometric Systems/notes/4. Face recognition.md @@ -18,4 +18,131 @@ Steps: - Requisiti: deve funzionare indipendentemente da posizione, orientamento, dimensione, espressione, soggetti nell'immagine, illuminazione e sfondo. ##### Ci si può nascondere? -Secondo Adam Harvey, il punto chiave che i computer rilevano è il "nose bridge", o l'area tra gli occhi. Se si nascondono si può far credere al computer che non ci sia una faccia. \ No newline at end of file +Secondo Adam Harvey, il punto chiave che i computer rilevano è il "nose bridge", o l'area tra gli occhi. Se si nascondono si può far credere al computer che non ci sia una faccia. + +Approcci di diversa natura: +- **Basati su feature:** si individuano le feature principali di una faccia (ad esempio posizione occhi, posizione naso, etc..) e poi si possono verificare diverse proprietà di queste (es.: colore della pelle corretto o distanza tra naso e occhi entro una certa soglia) +- **Basati su immagine:** solitamente vengono utilizzati dei modelli di machine learning che imparano da immagini esemplificative. + +> [!PDF|yellow] [[LEZIONE5_NEW_More about face localization.pdf#page=4&selection=56,0,61,0&color=yellow|LEZIONE5_NEW_More about face localization, p.4]] +> > pixels with the top 5 percent +> +> white compensation using Luma + +RGB is not a preceptually uniform space +- colors close to each other in RGB space may not be perceived as similar + +RGB to YCrCb +![[Pasted image 20241023133231.png]] +Darker region may have dominant blue component, light region red. + +Algoritmo A: +- variance-based segmentation + - the simplest method is thresholding + - we have an image I with L gray levels + - $n_i$ is the number of pixels with gray level $i$ + - $p_i = \frac{n_i}{MxN}$ is the probability of gray level i + - we divide pixel in two classes C0 and C1 by a gray level t + - for each class we can compute mean and variance of gray level![[Pasted image 20241023135127.png]] +- connected components + - skin tone pixels are segmented using local color variance![[Pasted image 20241023135925.png]] + +Eye localization +The algorithm builds two different eye maps (chroma and luma) + - **Chrominance map:** its creation relies on the observation that the region around eyes is characterized by high values of Cb and low values of Cr: $EyeMapC = \frac{1}{3}[(C_B^2)+(C_R^2)+(\frac{C_b}{C_r})]$ + - **Luminance map:** eyes usually contain both light and dark zones that can be highlighted by morphological operators (dilation and erosion with hemispheric structuring elements)![[Pasted image 20241023140250.png]] + +Chroma map is enhanced by histogram equalization +The two maps are combined through AND operator +The resulting map undergoes dilation, masking and normalization to discard the other face regions and brighten eyes +Further operations allow to refine this map. + +**Dilation** +The dilation operator takes two pieces of data as inputs. The first is the image which is to be dilated. The second is a (usually small) set of coordinate points known as a structuring element (also known as a kernel). It is this structuring element that determines the precise effect of the dilation on the input image. + +**Erosion** +The erosion operator takes two pieces of data as inputs. The first is the image which is to be eroded. The second is a (usually small) set of coordinate points known as a structuring element (also known as a kernel). It is this structuring element that determines the precise effect of the erosion on the input image. + +![[Pasted image 20241023141948.png]] + +The algorithm analyzes all the triangles composed by two candidate eyes and a candidate mouth. Each triangle is verified by checking: +- Luma variations and average of the orientation gradient of the blobs containing eyes and mouth +- Geometry and orientation of the triangle +- Presence of a face contour around the triangle + +#### Algoritmo B +Viola Jones rappresenta una vera e propria innovazione per quanta riguarda la localizzazione di una faccia all'interno di un’immagine. Essendo l’algoritmo basato su machine learning, il training di questo è avvenuto utilizzando un dataset personalizzato nel quale vengono etichettate immagini come positive nel caso in cui ci sia una faccia e come negative nel caso in cui non ve ne sia alcuna. + +L'agoritmo image based usa un classifier inizialmente trainato con varie istanze delle classi da identificare (esempi positivi) e classi di immagini che non contengono nessun oggetto della classe (esempi negativi). + +L'obiettivo del training è estrarre features dagli esempi e selezionare quelle più discriminative. Il modello costruito in modo incrementale e contiene le features. + +L'algoritmo fa uso di: +- **Ada-Boosting** per la selezione di feature: vengono creati diversi weak classifier, uno per feature, e tramite adaptive boosting riusciamo a creare uno strong classifier composto da un subset di weak-classifier.![[Pasted image 20241023144725.png]] + + AdaBoost è una tecnica di addestramento che ha lo scopo di apprendere la sequenza ottimale di classificatori deboli e i corrispondenti pesi. + Richiede un insieme di pattern di training {(x1,y1),(x2,y2),...,(xN,yN)}, dove yi ∈{-1,+1} è l’etichetta della classe associata al pattern. Inoltre durante l’apprendimento è calcolata e aggiornata una distribuzione di pesi [w1,w2,...,wN] associati ai pattern di training, wi è associato al pattern (xi ,yi). +Dopo l’iterazione m, è assegnato ai pattern più difficili da classificare un peso w1(m) superiore, cosicché alla successiva iterazione m+1 tali pattern riceveranno un’attenzione maggiore. + +un weak classifier è spesso un classifier lineare. Può essere comparato a una linea dritta. +![[Pasted image 20241024090856.png]] +in questo caso non va bene perché non tutti i rossi stanno dallo stesso lato. Nell'esempio è impossibile separare le due classi usando linee dritte. +p.s. non è un classifier a caso, è quello che in questo round ha il numero di errori minore. + +![[Pasted image 20241024091151.png]] +Per trovare una classificazione che separa i sample problematici, incrementiamo i pesi. +![[Pasted image 20241024091235.png]] +questo classificatore separa correttamente i sample problematici +![[Pasted image 20241024091433.png]]![[Pasted image 20241024091446.png]] +![[Pasted image 20241024091511.png]] + +##### Classifying faces with AdaBoost +Estraiamo feature rettangolari dalle immagini: le Haar features. +![[Pasted image 20241024092146.png]] + +Quello che fa è calcolare: somma dell'intensità dei pixel che si trovano nell'area bianca) - somma dell'intensità dei pixel nell'area nera. Se il risultato dell’operazione è un numero grande allora vuol dire che con alta probabilità in quella porzione di immagine è presente la features identificata dal filtro (il filtro è uno dei quadrati sopra), dove ad esempio nel caso del B (nell'immagine sopra) sono angoli. + +Per un immagine 24x24px, il numero di possibili rettangoli di features è 160'000! +Come si calcolano le Haar features? Possiamo usare AdaBoost per scegliere quali usare. + +![[Pasted image 20241024092903.png]] +esempio molto stupido + +![[Pasted image 20241024093000.png]] +esempio un po' meno stupido + +Per ogni round di adaboost: +- proviamo ogni filtro rettangolare su ogni esempio +- scegliamo la threshold migliore per ogni filtro +- scegliamo la miglior combo filtro/threshold +- ricalcoliamo i pesi +Complessità computazionale: O(MNT) +- M filters +- N examples +- T thresholds + +Le rectangular features possono essere valutate attraverso immagini integral il quale nome viene dato, in ambito computer vision, ad un algoritmo con annessa struttura dati chiamata Summed-Area table, la quale ci consente di calcolare l’area di una sottomatrice in tempo costante. +L'immagine integrale in posizione (x,y) è la somma del valore dei pixel sopra e a sinistra di (x,y): +$$II(x,y)=\sum_{x'<=x,y'<=y}I(x',y')$$ +Usando integral image è possibile calcolare la somma dei valori dei pixel in ogni rettangolo: +![[Pasted image 20241024094223.png]] + +Il singolo weak classifier dipende dai parametri $z_k$ (feature) e $t_k$ (threshold): +- per ogni feature scegliamo un valore di threshold che minimizza l'errore di classificazione +- si sceglie poi la feature con meno errore + +Un solo classificatore robusto, per quanto elimini una grande porzione di sottofinestre che non contengono facce, non soddisfa i requisiti di applicazioni. Una possibile soluzione consiste nell'impiego di classificatori in cascata (cascade classifier), via via più complessi: +![[Pasted image 20241024095704.png]] + +un classificatore per 1 sola feature riesce a passare al secondo stadio la quasi totalità dei volti esistenti (circa 100%) mentre scarta al contempo il 50% dei falsi volti. +Un classificatore per 5 feature raggiunge quasi il 100% di detection rate e il 40% di false positive rate (20% cumulativo) usando i dati dello stadio precedente. +Un classificatore per 20 feature raggiunge quasi il 100% di detection rate con 10% di false positive rate (2% cumulativo). + +La localizzazione dei volti avviene analizzando sottofinestre consecutive (sovrapposte) +dell’immagine in input e valutando per ciascuna se appartiene alla classe dei volti: +![[Pasted image 20241024100002.png]] + +#### Valutazione della localizzazione +- **Falsi positivi:** percentuale di finestre classificate come volto che in realtà non lo contengono +- **Facce non localizzate:** percentuale di volti che non sono stati individuati +- **C-ERROR** o Errore di localizzazione: distanza euclidea tra il reale centro della faccia e quello ipotizzato dal sistema, normalizzato rispetto alla somma degli assi dell’ellisse contenente il volto. \ No newline at end of file diff --git a/Biometric Systems/slides/LEZIONE5_NEW_More about face localization.pdf b/Biometric Systems/slides/LEZIONE5_NEW_More about face localization.pdf new file mode 100644 index 0000000..87194fc Binary files /dev/null and b/Biometric Systems/slides/LEZIONE5_NEW_More about face localization.pdf differ diff --git a/Pasted image 20241023133231.png b/Pasted image 20241023133231.png new file mode 100644 index 0000000..6f4417e Binary files /dev/null and b/Pasted image 20241023133231.png differ diff --git a/Pasted image 20241023135125.png b/Pasted image 20241023135125.png new file mode 100644 index 0000000..5272b4e Binary files /dev/null and b/Pasted image 20241023135125.png differ diff --git a/Pasted image 20241023135127.png b/Pasted image 20241023135127.png new file mode 100644 index 0000000..5272b4e Binary files /dev/null and b/Pasted image 20241023135127.png differ diff --git a/Pasted image 20241023135922.png b/Pasted image 20241023135922.png new file mode 100644 index 0000000..bc6644b Binary files /dev/null and b/Pasted image 20241023135922.png differ diff --git a/Pasted image 20241023135924.png b/Pasted image 20241023135924.png new file mode 100644 index 0000000..bc6644b Binary files /dev/null and b/Pasted image 20241023135924.png differ diff --git a/Pasted image 20241023135925.png b/Pasted image 20241023135925.png new file mode 100644 index 0000000..bc6644b Binary files /dev/null and b/Pasted image 20241023135925.png differ diff --git a/Pasted image 20241023140250.png b/Pasted image 20241023140250.png new file mode 100644 index 0000000..9aaba44 Binary files /dev/null and b/Pasted image 20241023140250.png differ diff --git a/Pasted image 20241023141948.png b/Pasted image 20241023141948.png new file mode 100644 index 0000000..752a73c Binary files /dev/null and b/Pasted image 20241023141948.png differ diff --git a/Pasted image 20241023144721.png b/Pasted image 20241023144721.png new file mode 100644 index 0000000..dddb141 Binary files /dev/null and b/Pasted image 20241023144721.png differ diff --git a/Pasted image 20241023144725.png b/Pasted image 20241023144725.png new file mode 100644 index 0000000..dddb141 Binary files /dev/null and b/Pasted image 20241023144725.png differ diff --git a/Pasted image 20241024090856.png b/Pasted image 20241024090856.png new file mode 100644 index 0000000..b905e40 Binary files /dev/null and b/Pasted image 20241024090856.png differ diff --git a/Pasted image 20241024091151.png b/Pasted image 20241024091151.png new file mode 100644 index 0000000..a869fa0 Binary files /dev/null and b/Pasted image 20241024091151.png differ diff --git a/Pasted image 20241024091235.png b/Pasted image 20241024091235.png new file mode 100644 index 0000000..787c5f2 Binary files /dev/null and b/Pasted image 20241024091235.png differ diff --git a/Pasted image 20241024091433.png b/Pasted image 20241024091433.png new file mode 100644 index 0000000..72ac58c Binary files /dev/null and b/Pasted image 20241024091433.png differ diff --git a/Pasted image 20241024091446.png b/Pasted image 20241024091446.png new file mode 100644 index 0000000..852b8f3 Binary files /dev/null and b/Pasted image 20241024091446.png differ diff --git a/Pasted image 20241024091511.png b/Pasted image 20241024091511.png new file mode 100644 index 0000000..88c1551 Binary files /dev/null and b/Pasted image 20241024091511.png differ diff --git a/Pasted image 20241024092146.png b/Pasted image 20241024092146.png new file mode 100644 index 0000000..3a4becc Binary files /dev/null and b/Pasted image 20241024092146.png differ diff --git a/Pasted image 20241024092903.png b/Pasted image 20241024092903.png new file mode 100644 index 0000000..06ae070 Binary files /dev/null and b/Pasted image 20241024092903.png differ diff --git a/Pasted image 20241024093000.png b/Pasted image 20241024093000.png new file mode 100644 index 0000000..4d97513 Binary files /dev/null and b/Pasted image 20241024093000.png differ diff --git a/Pasted image 20241024094223.png b/Pasted image 20241024094223.png new file mode 100644 index 0000000..4a55c71 Binary files /dev/null and b/Pasted image 20241024094223.png differ diff --git a/Pasted image 20241024095704.png b/Pasted image 20241024095704.png new file mode 100644 index 0000000..8a3ffae Binary files /dev/null and b/Pasted image 20241024095704.png differ diff --git a/Pasted image 20241024100002.png b/Pasted image 20241024100002.png new file mode 100644 index 0000000..48e0a19 Binary files /dev/null and b/Pasted image 20241024100002.png differ