|
64 | 64 | | -------------------------------------------- | -------------------------------------- | |
65 | 65 | |  |  | |
66 | 66 |
|
67 | | -| Malicious Vote Detected (Malicious User Behaviour) | Malicious Vote (Outside Region) | |
68 | | -| -------------------------------------------------- | ------------------------------------------------------- | |
69 | | -|  |  | |
70 | | - |
71 | | -### Interactive Walkthrough |
| 67 | +| Malicious Vote Detected (Malicious User Behavior) | Malicious Vote (Outside Region) | |
| 68 | +| ------------------------------------------------- | ------------------------------------------------------- | |
| 69 | +|  |  | |
72 | 70 |
|
73 | 71 | | Landing Page Demo | Login Demo | |
74 | 72 | | -------------------------------------------------- | --------------------------------------- | |
|
83 | 81 | <!-- Development & Testing --> |
84 | 82 | <img src="./readme/title6.svg"/> |
85 | 83 |
|
86 | | -### Add Title Here |
| 84 | +### Some Code Snippets! |
87 | 85 |
|
88 | | -| Services | Validation | Testing | |
89 | | -| --------------------------------------- | ------------------------------------- | ------------------------------------- | |
90 | | -|  |  |  | |
| 86 | +| Get Stats Service (Dashboard) | Edit Profile Backend Validation | Register Login Testing | |
| 87 | +| ------------------------------------------------------------ | ---------------------------------------------------------------------------- | -------------------------------------------------------------- | |
| 88 | +|  |  |  | |
91 | 89 |
|
92 | 90 | <br><br> |
93 | 91 |
|
94 | | -<!-- Deployment --> |
| 92 | +### Some Code Snippets! |
| 93 | + |
| 94 | +| Working Pipeline | |
| 95 | +| ----------------------------------------------- | |
| 96 | +|  | |
| 97 | + |
| 98 | +<br><br> |
| 99 | + |
| 100 | +<!-- AI-Powered App --> |
95 | 101 | <img src="./readme/title7.svg"/> |
96 | 102 |
|
97 | | -### Add Title Here |
| 103 | +### AI-Powered Vote Validation |
98 | 104 |
|
99 | | -<!-- - Description here. |
| 105 | +- **How it Works** |
100 | 106 |
|
101 | | -| Postman API 1 | Postman API 2 | Postman API 3 | |
102 | | -| --------------------------------------- | ------------------------------------- | ------------------------------------- | |
103 | | -|  |  |  | --> |
| 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 | +|  |  | |
| 159 | + |
| 160 | +| Fallback Vote Analysis Function | Haversine Distance Calculation Function | |
| 161 | +| ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------- | |
| 162 | +|  |  | |
104 | 163 |
|
105 | 164 | <br><br> |
106 | 165 |
|
|
0 commit comments