vault backup: 2024-11-14 01:31:24
This commit is contained in:
parent
bc43175468
commit
b21b11655a
12 changed files with 145 additions and 29 deletions
8
.obsidian/plugins/companion/data.json
vendored
8
.obsidian/plugins/companion/data.json
vendored
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"provider": "ollama",
|
||||
"model": "qwen2.5:14b",
|
||||
"model": "llama3:8b-text-q8_0",
|
||||
"enable_by_default": false,
|
||||
"keybind": "Tab",
|
||||
"delay_ms": 2000,
|
||||
|
@ -13,16 +13,12 @@
|
|||
"min_display_length": 50,
|
||||
"retrigger_threshold": 48
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
"provider_settings": {
|
||||
"ollama": {
|
||||
"settings": "{\"endpoint\":\"http://192.168.188.43:11434\"}",
|
||||
"settings": "{\"endpoint\":\"http://pve-gpu.net.mrlc.cc:11434\"}",
|
||||
"models": {}
|
||||
}
|
||||
},
|
||||
=======
|
||||
"provider_settings": {},
|
||||
>>>>>>> origin/main
|
||||
"presets": [],
|
||||
"fallback": null
|
||||
}
|
2
.obsidian/plugins/local-gpt/data.json
vendored
2
.obsidian/plugins/local-gpt/data.json
vendored
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"providers": {
|
||||
"ollama": {
|
||||
"ollamaUrl": "http://localhost:11434",
|
||||
"ollamaUrl": "http://pve-gpu.net.mrlc.cc:11434",
|
||||
"defaultModel": "qwen2.5:14b",
|
||||
"embeddingModel": "nomic-embed-text",
|
||||
"type": "ollama"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"isIncognitoMode": true,
|
||||
"ollamaGenModel": {
|
||||
"model": "qwen2.5:14b",
|
||||
"baseUrl": "http://localhost:11434",
|
||||
"baseUrl": "http://pve-gpu.net.mrlc.cc:11434",
|
||||
"temperature": 0.5,
|
||||
"contextWindow": 2048,
|
||||
"lcModel": {
|
||||
|
@ -140,7 +140,7 @@
|
|||
},
|
||||
"ollamaEmbedModel": {
|
||||
"model": "nomic-embed-text",
|
||||
"baseUrl": "http://localhost:11434",
|
||||
"baseUrl": "http://pve-gpu.net.mrlc.cc:11434",
|
||||
"similarityThreshold": 0.5,
|
||||
"k": 100
|
||||
},
|
||||
|
|
93
.obsidian/workspace.json
vendored
93
.obsidian/workspace.json
vendored
|
@ -6,6 +6,7 @@
|
|||
{
|
||||
"id": "d43d10180ff70873",
|
||||
"type": "tabs",
|
||||
"dimension": 47.536496350364956,
|
||||
"children": [
|
||||
{
|
||||
"id": "86cc34a714fe2576",
|
||||
|
@ -13,12 +14,64 @@
|
|||
"state": {
|
||||
"type": "markdown",
|
||||
"state": {
|
||||
"file": "Autonomous Networking/notes/q&a.md",
|
||||
"file": "Biometric Systems/notes/8 Face anti spoofing.md",
|
||||
"mode": "source",
|
||||
"source": false
|
||||
},
|
||||
"icon": "lucide-file",
|
||||
"title": "q&a"
|
||||
"title": "8 Face anti spoofing"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "694d2f6c89ce8b0a",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "image",
|
||||
"state": {
|
||||
"file": "Biometric Systems/images/Pasted image 20241113134358.png"
|
||||
},
|
||||
"icon": "lucide-image",
|
||||
"title": "Pasted image 20241113134358"
|
||||
}
|
||||
}
|
||||
],
|
||||
"currentTab": 1
|
||||
},
|
||||
{
|
||||
"id": "ddd22570aec87d07",
|
||||
"type": "tabs",
|
||||
"dimension": 52.463503649635044,
|
||||
"children": [
|
||||
{
|
||||
"id": "49892e00594998ab",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "pdf",
|
||||
"state": {
|
||||
"file": "Biometric Systems/slides/LEZIONE8_Face antispoofing.pdf",
|
||||
"page": 30,
|
||||
"left": -31,
|
||||
"top": 39,
|
||||
"zoom": 0.47708333333333336
|
||||
},
|
||||
"icon": "lucide-file-text",
|
||||
"title": "LEZIONE8_Face antispoofing"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "939013fa26b445e1",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "pdf",
|
||||
"state": {
|
||||
"file": "Biometric Systems/slides/Biometric_System___Notes.pdf",
|
||||
"page": 20,
|
||||
"left": 71,
|
||||
"top": 432,
|
||||
"zoom": 0.9
|
||||
},
|
||||
"icon": "lucide-file-text",
|
||||
"title": "Biometric_System___Notes"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -163,8 +216,8 @@
|
|||
"state": {
|
||||
"file": "Chats/New Chat.md"
|
||||
},
|
||||
"icon": "message-square",
|
||||
"title": "New Chat"
|
||||
"icon": "lucide-file",
|
||||
"title": "Plugin no longer active"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
@ -172,8 +225,7 @@
|
|||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 604.5,
|
||||
"collapsed": true
|
||||
"width": 604.5
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
|
@ -192,10 +244,23 @@
|
|||
"companion:Toggle completion": false
|
||||
}
|
||||
},
|
||||
"active": "86cc34a714fe2576",
|
||||
"active": "0d5325c0f9289cea",
|
||||
"lastOpenFiles": [
|
||||
"conflict-files-obsidian-git.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",
|
||||
"Biometric Systems/slides/LEZIONE8_Face antispoofing.pdf",
|
||||
"Biometric Systems/notes/8 Face anti spoofing.md",
|
||||
"Biometric Systems/slides/Biometric_System___Notes.pdf",
|
||||
"Biometric Systems/notes/6. Face recognition 2D.md",
|
||||
"Autonomous Networking/slides/AutonomousNet-Class13-2122-Optimal_policy_and_Qlearning.pdf",
|
||||
"Autonomous Networking/notes/10 Q-Learning.md",
|
||||
"Autonomous Networking/notes/q&a.md",
|
||||
"Autonomous Networking/notes/7.2 10 arm testbed - optimism in face of uncertainty.md",
|
||||
"Autonomous Networking/notes/9 Markov processes.md",
|
||||
"conflict-files-obsidian-git.md",
|
||||
"Biometric Systems/slides/LEZIONE7_Face recognition3D.pdf",
|
||||
"Biometric Systems/images/Pasted image 20241106144314.png",
|
||||
"Biometric Systems/images/Pasted image 20241106143837.png",
|
||||
|
@ -203,28 +268,20 @@
|
|||
"Biometric Systems/images/Pasted image 20241106142539.png",
|
||||
"Biometric Systems/images/Pasted image 20241106142538.png",
|
||||
"Biometric Systems/images/Pasted image 20241106142523.png",
|
||||
"Biometric Systems/images/Pasted image 20241106142503.png",
|
||||
"Biometric Systems/images/Pasted image 20241106140241.png",
|
||||
"Biometric Systems/images/Pasted image 20241106140102.png",
|
||||
"Biometric Systems/images/Pasted image 20241106135900.png",
|
||||
"Autonomous Networking/notes/2 RFID.md",
|
||||
"Autonomous Networking/notes/6 Internet of Things.md",
|
||||
"Autonomous Networking/notes/5 Drones.md",
|
||||
"Biometric Systems/notes/6. Face recognition 2D.md",
|
||||
"Biometric Systems/notes/4. Face detection.md",
|
||||
"Biometric Systems/notes/3. Recognition Reliability.md",
|
||||
"Biometric Systems/notes/2. Performance indexes.md",
|
||||
"Biometric Systems/notes/1. Introduction.md",
|
||||
"Autonomous Networking/notes/4 WSN Routing.md",
|
||||
"Foundation of data science/notes/4 L1 and L2 normalization.md",
|
||||
"Autonomous Networking/notes/7.2 10 arm testbed - optimism in face of uncertainty.md",
|
||||
"Autonomous Networking/notes/7.1 K-Armed bandit problem.md",
|
||||
"Autonomous Networking/notes/7 RL.md",
|
||||
"Autonomous Networking/slides/7 RL1.pdf",
|
||||
"Autonomous Networking/slides/9markovprocess.pdf",
|
||||
"Autonomous Networking/slides/AutonomousNet-Class11-2122-Performance_of_action_selection_methods_UCB.pdf",
|
||||
"Autonomous Networking/slides/AutonomousNet-Class13-2122-Optimal_policy_and_Qlearning.pdf",
|
||||
"Autonomous Networking/notes/9 Markov processes.md",
|
||||
"Autonomous Networking/slides/6 IoT.pdf",
|
||||
"Foundation of data science/notes/2 Logistic Regression.md",
|
||||
"Foundation of data science/notes/3 Multi Class Binary Classification.md",
|
||||
|
@ -232,13 +289,9 @@
|
|||
"Foundation of data science/slides/Untitled.md",
|
||||
"Senza nome.md",
|
||||
"Biometric Systems/slides/LEZIONE6_Face recognition2D.pdf",
|
||||
"Biometric Systems/slides/Biometric_System___Notes.pdf",
|
||||
"Autonomous Networking/slides/AutonomousNet-Class10-2122-Multiarmed_bandit.pdf",
|
||||
"Autonomous Networking/notes/8.md",
|
||||
"Foundation of data science/notes/1 CV Basics.md",
|
||||
"Foundation of data science/images",
|
||||
"Autonomous Networking/notes/3 WSN MAC.md",
|
||||
"Autonomous Networking/notes/6.1 RL.md",
|
||||
"Senza nome.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.
|
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