vault backup: 2024-11-14 07:10:49
This commit is contained in:
commit
0dedfdf0ef
13 changed files with 100 additions and 21 deletions
8
.obsidian/plugins/companion/data.json
vendored
8
.obsidian/plugins/companion/data.json
vendored
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"provider": "ollama",
|
"provider": "ollama",
|
||||||
"model": "qwen2.5:14b",
|
"model": "llama3:8b-text-q8_0",
|
||||||
"enable_by_default": false,
|
"enable_by_default": false,
|
||||||
"keybind": "Tab",
|
"keybind": "Tab",
|
||||||
"delay_ms": 2000,
|
"delay_ms": 2000,
|
||||||
|
@ -13,16 +13,12 @@
|
||||||
"min_display_length": 50,
|
"min_display_length": 50,
|
||||||
"retrigger_threshold": 48
|
"retrigger_threshold": 48
|
||||||
},
|
},
|
||||||
<<<<<<< HEAD
|
|
||||||
"provider_settings": {
|
"provider_settings": {
|
||||||
"ollama": {
|
"ollama": {
|
||||||
"settings": "{\"endpoint\":\"http://192.168.188.43:11434\"}",
|
"settings": "{\"endpoint\":\"http://pve-gpu.net.mrlc.cc:11434\"}",
|
||||||
"models": {}
|
"models": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
=======
|
|
||||||
"provider_settings": {},
|
|
||||||
>>>>>>> origin/main
|
|
||||||
"presets": [],
|
"presets": [],
|
||||||
"fallback": null
|
"fallback": null
|
||||||
}
|
}
|
2
.obsidian/plugins/local-gpt/data.json
vendored
2
.obsidian/plugins/local-gpt/data.json
vendored
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"providers": {
|
"providers": {
|
||||||
"ollama": {
|
"ollama": {
|
||||||
"ollamaUrl": "http://localhost:11434",
|
"ollamaUrl": "http://pve-gpu.net.mrlc.cc:11434",
|
||||||
"defaultModel": "qwen2.5:14b",
|
"defaultModel": "qwen2.5:14b",
|
||||||
"embeddingModel": "nomic-embed-text",
|
"embeddingModel": "nomic-embed-text",
|
||||||
"type": "ollama"
|
"type": "ollama"
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"isIncognitoMode": true,
|
"isIncognitoMode": true,
|
||||||
"ollamaGenModel": {
|
"ollamaGenModel": {
|
||||||
"model": "qwen2.5:14b",
|
"model": "qwen2.5:14b",
|
||||||
"baseUrl": "http://localhost:11434",
|
"baseUrl": "http://pve-gpu.net.mrlc.cc:11434",
|
||||||
"temperature": 0.5,
|
"temperature": 0.5,
|
||||||
"contextWindow": 2048,
|
"contextWindow": 2048,
|
||||||
"lcModel": {
|
"lcModel": {
|
||||||
|
@ -140,7 +140,7 @@
|
||||||
},
|
},
|
||||||
"ollamaEmbedModel": {
|
"ollamaEmbedModel": {
|
||||||
"model": "nomic-embed-text",
|
"model": "nomic-embed-text",
|
||||||
"baseUrl": "http://localhost:11434",
|
"baseUrl": "http://pve-gpu.net.mrlc.cc:11434",
|
||||||
"similarityThreshold": 0.5,
|
"similarityThreshold": 0.5,
|
||||||
"k": 100
|
"k": 100
|
||||||
},
|
},
|
||||||
|
|
39
.obsidian/workspace.json
vendored
39
.obsidian/workspace.json
vendored
|
@ -20,8 +20,23 @@
|
||||||
"icon": "lucide-file",
|
"icon": "lucide-file",
|
||||||
"title": "6. Face recognition 2D"
|
"title": "6. Face recognition 2D"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "71d0915358d5bebb",
|
||||||
|
"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": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"direction": "vertical"
|
"direction": "vertical"
|
||||||
|
@ -180,10 +195,19 @@
|
||||||
"obsidian-git:Open Git source control": false
|
"obsidian-git:Open Git source control": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"active": "579822ce920333ff",
|
"active": "71d0915358d5bebb",
|
||||||
"lastOpenFiles": [
|
"lastOpenFiles": [
|
||||||
"Biometric Systems/notes/4. Face detection.md",
|
|
||||||
"Biometric Systems/notes/6. Face recognition 2D.md",
|
"Biometric Systems/notes/6. Face recognition 2D.md",
|
||||||
|
"conflict-files-obsidian-git.md",
|
||||||
|
"Biometric Systems/slides/LEZIONE8_Face antispoofing.pdf",
|
||||||
|
"Biometric Systems/notes/8 Face anti spoofing.md",
|
||||||
|
"Biometric Systems/images/Pasted image 20241113144743.png",
|
||||||
|
"Biometric Systems/images/Pasted image 20241113144129.png",
|
||||||
|
"Biometric Systems/images/Pasted image 20241113143053.png",
|
||||||
|
"Biometric Systems/images/Pasted image 20241113140703.png",
|
||||||
|
"Biometric Systems/images/Pasted image 20241113134358.png",
|
||||||
|
"Autonomous Networking/notes/10 Q-Learning.md",
|
||||||
|
"Biometric Systems/notes/4. Face detection.md",
|
||||||
"Biometric Systems/notes/7. Face recognition 3D.md",
|
"Biometric Systems/notes/7. Face recognition 3D.md",
|
||||||
"Foundation of data science/notes/5 Neural Networks.md",
|
"Foundation of data science/notes/5 Neural Networks.md",
|
||||||
"Biometric Systems/slides/LEZIONE5_NEW_More about face localization.pdf",
|
"Biometric Systems/slides/LEZIONE5_NEW_More about face localization.pdf",
|
||||||
|
@ -201,13 +225,7 @@
|
||||||
"Pasted image 20241107102227.png",
|
"Pasted image 20241107102227.png",
|
||||||
"Pasted image 20241107101136.png",
|
"Pasted image 20241107101136.png",
|
||||||
"Pasted image 20241107093316.png",
|
"Pasted image 20241107093316.png",
|
||||||
"Pasted image 20241107093019.png",
|
|
||||||
"Pasted image 20241107092327.png",
|
|
||||||
"Pasted image 20241107091228.png",
|
|
||||||
"Pasted image 20241107091114.png",
|
|
||||||
"Pasted image 20241107090827.png",
|
|
||||||
"Foundation of data science/notes/2 Logistic Regression.md",
|
"Foundation of data science/notes/2 Logistic Regression.md",
|
||||||
"conflict-files-obsidian-git.md",
|
|
||||||
"Senza nome.md",
|
"Senza nome.md",
|
||||||
"Autonomous Networking/notes/7 RL.md",
|
"Autonomous Networking/notes/7 RL.md",
|
||||||
"Foundation of data science/slides/Untitled.md",
|
"Foundation of data science/slides/Untitled.md",
|
||||||
|
@ -218,15 +236,12 @@
|
||||||
"Autonomous Networking/slides/2 RFID.pdf",
|
"Autonomous Networking/slides/2 RFID.pdf",
|
||||||
"Autonomous Networking/slides/9markovprocess.pdf",
|
"Autonomous Networking/slides/9markovprocess.pdf",
|
||||||
"Autonomous Networking/slides/AutonomousNet-Class11-2122-Performance_of_action_selection_methods_UCB.pdf",
|
"Autonomous Networking/slides/AutonomousNet-Class11-2122-Performance_of_action_selection_methods_UCB.pdf",
|
||||||
"Autonomous Networking/slides/AutonomousNet-Class10-2122-Multiarmed_bandit.pdf",
|
|
||||||
"K-Armed bandit problem.md",
|
"K-Armed bandit problem.md",
|
||||||
"Autonomous Networking/notes/6 Internet of Things.md",
|
"Autonomous Networking/notes/6 Internet of Things.md",
|
||||||
"Autonomous Networking/notes/3 WSN MAC.md",
|
"Autonomous Networking/notes/3 WSN MAC.md",
|
||||||
"Chats/New Chat.md",
|
"Chats/New Chat.md",
|
||||||
"Autonomous Networking/notes/4 WSN Routing.md",
|
"Autonomous Networking/notes/4 WSN Routing.md",
|
||||||
"Foundation of data science/notes/Logistic Regression for C > 1.md",
|
"Foundation of data science/notes/Logistic Regression for C > 1.md",
|
||||||
"Foundation of data science/notes/Logistic Regression.md",
|
|
||||||
"Foundation of data science/notes/1 CV Basics.md",
|
|
||||||
"Untitled.canvas"
|
"Untitled.canvas"
|
||||||
]
|
]
|
||||||
}
|
}
|
20
Autonomous Networking/notes/10 Q-Learning.md
Normal file
20
Autonomous Networking/notes/10 Q-Learning.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
Let's define the Bellman Optimality Equation: $v(s)=$ $( v^*(s) = \max_a \sum_{s', r} p(s',r|s,a)[r + \gamma v^*(s')])$, where $(v^*(s))$ represents the optimal value function for state \(s\).
|
||||||
|
|
||||||
|
The equation is not closed, but there are several ways to compute it:
|
||||||
|
- dynamic programming
|
||||||
|
- ...
|
||||||
|
- Q-Learning
|
||||||
|
|
||||||
|
Q-Learning is an iterative way to do it, that learns the optimal values "online".
|
||||||
|
|
||||||
|
Q-Learning is the fusion of TD-Learning and Off Policy.
|
||||||
|
|
||||||
|
#### Temporal Difference Learning
|
||||||
|
At each step the state value is updates:
|
||||||
|
$$V(S_{t})=V(S_{t})+\alpha[R_{t+1}+\gamma V(S_{t+1})-V(S_{t})]$$
|
||||||
|
|
||||||
|
This is a special case of the $TD(\lambda)$ called $TD(0)$, or one-step TD. It works by updating the previous estimate every time an action has been taken.
|
||||||
|
|
||||||
|
#### Q-Learning
|
||||||
|
$$Q(S, a)=Q(S, a)+\alpha(R+\gamma max_{a'}(Q(S', a')-Q(S, a))$$
|
||||||
|
This will converge to the optimal action value function.
|
|
@ -108,3 +108,4 @@ Basic principle: the value of a state is the expected reward I get exiting from
|
||||||
*add backup diagram*
|
*add backup diagram*
|
||||||
|
|
||||||
$$v_{\pi}(s)=\sum_{a \in A}\pi(a|s)q(a, s)=\sum_{a \in A}\pi(a|s)\left( R_{s}^a+\gamma \sum_{s' \in S}P_{ss'}^av_{\pi}(s') \right)$$
|
$$v_{\pi}(s)=\sum_{a \in A}\pi(a|s)q(a, s)=\sum_{a \in A}\pi(a|s)\left( R_{s}^a+\gamma \sum_{s' \in S}P_{ss'}^av_{\pi}(s') \right)$$
|
||||||
|
>>>>>>> origin/main
|
||||||
|
|
BIN
Biometric Systems/images/Pasted image 20241113134358.png
Normal file
BIN
Biometric Systems/images/Pasted image 20241113134358.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 96 KiB |
BIN
Biometric Systems/images/Pasted image 20241113140703.png
Normal file
BIN
Biometric Systems/images/Pasted image 20241113140703.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 369 KiB |
BIN
Biometric Systems/images/Pasted image 20241113143053.png
Normal file
BIN
Biometric Systems/images/Pasted image 20241113143053.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 158 KiB |
BIN
Biometric Systems/images/Pasted image 20241113144129.png
Normal file
BIN
Biometric Systems/images/Pasted image 20241113144129.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
BIN
Biometric Systems/images/Pasted image 20241113144743.png
Normal file
BIN
Biometric Systems/images/Pasted image 20241113144743.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 280 KiB |
47
Biometric Systems/notes/8 Face anti spoofing.md
Normal file
47
Biometric Systems/notes/8 Face anti spoofing.md
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
Lo spoofing consiste nell'ingannare un sistema biometrico assumendo un'identità che non ci appartiene.
|
||||||
|
La differenza con il camouflage (camuffamento) è data dal fatto che nel primo l'obiettivo è essere riconosciuti con un'altra identità, nel secondo invece si tenta di non far riconoscere la propria identità.
|
||||||
|
|
||||||
|
L'attacco di spoofing può essere:
|
||||||
|
- **Diretto (1):** avviene al momento dell'acquisizione (attacchi di presentazione)
|
||||||
|
- **Indiretto (2-8):** avviene nelle fasi successive della pipeline
|
||||||
|
![[Pasted image 20241113134358.png]]
|
||||||
|
|
||||||
|
### Face spoofing
|
||||||
|
si classificano in attacchi di spoofing 2D e 3D
|
||||||
|
|
||||||
|
- **Print/photo attack:** viene presentata un'immagine del soggetto da identificare. Questo attacco può essere facilmente iderntificato (cambia il modo in cui riflette la luce ecc., LBP viene d'aiuto), oppure possiamo rilevare cose tipo il battito delle ciglia...
|
||||||
|
- **Video attack:** (o replay attack) viene presentato un video. Anche qui viene usato LBP nel tentativo di prevenire l'attacco
|
||||||
|
- **Maschera facciale:** viene prodotta una maschera 3D. Un modo per prevenirlo è vedere come la luce riflette sulla pelle (la plastica della maschera rifletterà in modo un po' diverso)
|
||||||
|
|
||||||
|
Se, in fase di valutazione, prendiamo in considerazione anche gli attacchi di spoofing, dobbiamo utilizzare una metrica diversa dal classico FAR, ovvero lo **Spoofing-FAR**, che prende quindi in considerazione anche i casi in cui gli impostori vengono accettati grazie allo spoofing.
|
||||||
|
|
||||||
|
### Face antispoofing - Liveness Detection
|
||||||
|
![[Pasted image 20241113140703.png]]
|
||||||
|
|
||||||
|
#### Liveness detection
|
||||||
|
La differenza essenziale tra una faccia vera e una foto è che la faccia è un oggetto tridimensionale, il movimento della faccia può aiutare a distinguere una persona vera da una foto (optical flow). Stimare la profondità da delle immagini 2D è difficile però, e la stima è molto sensibile al rumore e all'illuminazione. Inoltre, è vulnerabile al movimento della foto o la deformazione (bending) di questa (se curvo il foglio con la foto stampata tipo).
|
||||||
|
Si potrebbe anche provare a riconoscere le texture della carta.
|
||||||
|
|
||||||
|
Un altro modo è riconoscere il battito di ciglia, considerando che un battito dura circa 250ms e avviene tra i 2 e i 4 secondi, ci bastano circa 15 fps. Però è spoofabile perché si potrebbero ad es. fare dei buchi per gli occhi a una maschera.
|
||||||
|
> [!PDF|yellow] [[LEZIONE8_Face antispoofing.pdf#page=27&selection=2,0,3,1&color=yellow|LEZIONE8_Face antispoofing, p.27]]
|
||||||
|
> > The work by Pan et al. models
|
||||||
|
>
|
||||||
|
> modello Pan et al.
|
||||||
|
|
||||||
|
|
||||||
|
![[Pasted image 20241113143053.png]]
|
||||||
|
Hidden Markov model, modella la sequenza di stati di un occhio. (aggiungere altro)
|
||||||
|
|
||||||
|
//
|
||||||
|
LBP per riconoscere difetti di stampa analizzando le micro-texture della carta. Si basa sul fatto che nessuna stampante è perfetta, ogni foto ha dei "difetti" di stampa che possono essere riconosciuti con un po' di feature extraction.
|
||||||
|
- la faccia e le stampe riflettono la luce in modo diverso
|
||||||
|
- le proprietà della superficie di una faccia e di una stampa sono diverse
|
||||||
|
Le feature possono essere estrratte usando **multi-scale local binary patterns (LBP)**, si possono poi usare per trainare una **SVM**, che poi determinerà se le feature estratte caratterizzano una persona o una stampa.
|
||||||
|
|
||||||
|
![[Pasted image 20241113144129.png]]
|
||||||
|
vera foto vs stampa e rispettive immagini LBP.
|
||||||
|
|
||||||
|
Prima di applicare LBP la faccia viene riconosciuta, croppata e normalizzata come immagine 64x64.
|
||||||
|
![[Pasted image 20241113144743.png]]
|
||||||
|
|
||||||
|
LBP viene applicato
|
BIN
Biometric Systems/slides/LEZIONE8_Face antispoofing.pdf
Normal file
BIN
Biometric Systems/slides/LEZIONE8_Face antispoofing.pdf
Normal file
Binary file not shown.
Loading…
Reference in a new issue