Skip to content

Commit 22879ec

Browse files
Merge pull request #225 from Houssien-Zeineddine/readme
Readme
2 parents 994b22b + fd3d8de commit 22879ec

14 files changed

+81
-29
lines changed

README.md

Lines changed: 74 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,9 @@
6464
| -------------------------------------------- | -------------------------------------- |
6565
| ![Landing](./readme/demo/landing%20page.png) | ![fsdaf](./readme//demo/dashboard.png) |
6666

67-
| Malicious Vote Detected (Malicious User Behaviour) | Malicious Vote (Outside Region) |
68-
| -------------------------------------------------- | ------------------------------------------------------- |
69-
| ![Landing](./readme/demo/malicious%20vote.png) | ![fsdaf](./readme/demo/malicious%20vote%20location.png) |
70-
71-
### Interactive Walkthrough
67+
| Malicious Vote Detected (Malicious User Behavior) | Malicious Vote (Outside Region) |
68+
| ------------------------------------------------- | ------------------------------------------------------- |
69+
| ![Landing](./readme/demo/malicious%20vote.png) | ![fsdaf](./readme/demo/malicious%20vote%20location.png) |
7270

7371
| Landing Page Demo | Login Demo |
7472
| -------------------------------------------------- | --------------------------------------- |
@@ -83,24 +81,85 @@
8381
<!-- Development & Testing -->
8482
<img src="./readme/title6.svg"/>
8583

86-
### Add Title Here
84+
### Some Code Snippets!
8785

88-
| Services | Validation | Testing |
89-
| --------------------------------------- | ------------------------------------- | ------------------------------------- |
90-
| ![Landing](./readme/demo/1440x1024.png) | ![fsdaf](./readme/demo/1440x1024.png) | ![fsdaf](./readme/demo/1440x1024.png) |
86+
| Get Stats Service (Dashboard) | Edit Profile Backend Validation | Register Login Testing |
87+
| ------------------------------------------------------------ | ---------------------------------------------------------------------------- | -------------------------------------------------------------- |
88+
| ![Landing](./readme/code%20snippets/Dashboard%20service.png) | ![fsdaf](./readme/code%20snippets/edit%20profile%20backend%20validation.png) | ![fsdaf](./readme/code%20snippets/register%20login%20test.png) |
9189

9290
<br><br>
9391

94-
<!-- Deployment -->
92+
### Some Code Snippets!
93+
94+
| Working Pipeline |
95+
| ----------------------------------------------- |
96+
| ![Landing](./readme/working%20pipeline%201.png) |
97+
98+
<br><br>
99+
100+
<!-- AI-Powered App -->
95101
<img src="./readme/title7.svg"/>
96102

97-
### Add Title Here
103+
### AI-Powered Vote Validation
98104

99-
<!-- - Description here.
105+
- **How it Works**
100106

101-
| Postman API 1 | Postman API 2 | Postman API 3 |
102-
| --------------------------------------- | ------------------------------------- | ------------------------------------- |
103-
| ![Landing](./readme/demo/1440x1024.png) | ![fsdaf](./readme/demo/1440x1024.png) | ![fsdaf](./readme/demo/1440x1024.png) | -->
107+
To guarantee the integrity of the remote voting process, this system confidently utilizes AI to swiftly detect and filter out any suspicious or potentially malicious votes in real time.
108+
109+
- **Geolocation Validation**
110+
111+
Each vote undergoes rigorous verification against the election region’s established geofence utilizing the Haversine formula. If a voter's latitude and longitude fall outside the designated radius, the vote is promptly flagged as malicious and recorded with the reason: “Location outside election region.”
112+
113+
- **AI Behavioral Analysis**
114+
115+
For geolocation-valid votes, our AI model, utilizing the Prism PHP framework, conducts an in-depth analysis of voter behavior. It confidently constructs a context-aware prompt that considers:
116+
117+
- The number of votes a user has cast in the last 10 minutes
118+
- The exact time of voting.
119+
120+
- **AI Behavioral Analysis**
121+
122+
For geolocation-valid votes, our AI model, utilizing the Prism PHP framework, conducts an in-depth analysis of voter behavior. It confidently constructs a context-aware prompt that considers:
123+
124+
- The number of votes a user has cast in the last 10 minutes
125+
- The exact time of voting.
126+
127+
<br>
128+
129+
**This prompt is then submitted to OpenAI's GPT-4o model, adhering to a strict schema that expects two keys: status (counted or malicious) and result (detailed explanation).**
130+
131+
<br>
132+
133+
- **Based on the AI's assessment**
134+
135+
- When a vote is classified as counted, it is confidently stored in the CountedVotes table.
136+
- When a vote is identified as malicious, it is confidently recorded in the MaliciousVotes table, accompanied by the rationale provided by AI.
137+
138+
- **Failsafe: Smart Fallback Logic**
139+
140+
In the event of an AI request failure—whether from rate limiting or unforeseen errors—the system will confidently revert to a robust fallback heuristic. This guarantees that the service remains stable, preventing any disruptions to the voting process.
141+
142+
- **The fallback employs two definitive rules**
143+
144+
- High-Frequency Detection: Any user casting more than 5 votes within a span of 10 minutes triggers a flag.
145+
146+
- Odd-Hour Activity: Voting attempts occurring between 12:00 AM and 5:00 AM are scrutinized closely.
147+
148+
<br>
149+
150+
**Any deviation from these established patterns will categorize the vote as malicious, backed by clear reasoning; otherwise, the vote will be recognized as valid.**
151+
152+
**This robust validation mechanism not only bolsters trust and security but also guarantees high availability through effective error handling, ensuring the system remains reliable in all conditions.**
153+
154+
<br>
155+
156+
| Filter Vote | Analyze Vote Behavior (PrismPHP) Demo |
157+
| ------------------------------------------------------ | ----------------------------------------------------------------- |
158+
| ![Landing](./readme/code%20snippets/filter%20vote.png) | ![fsdaf](./readme/code%20snippets/analyze%20vote%20behaviour.png) |
159+
160+
| Fallback Vote Analysis Function | Haversine Distance Calculation Function |
161+
| ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
162+
| ![Landing](./readme/code%20snippets/fallback%20function%20incase%20ai%20crashed.png) | ![fsdaf](./readme/code%20snippets/haversine%20distance%20function.png) |
104163

105164
<br><br>
106165

365 KB
Loading
486 KB
Loading
486 KB
Loading
266 KB
Loading
287 KB
Loading
474 KB
Loading
294 KB
Loading
148 KB
Loading
464 KB
Loading

0 commit comments

Comments
 (0)