HRIS Technical Guide
Implementation & Operations

Facial Attendance System

A guide to what was built, how face-only kiosk attendance works, how it is secured, and how administrators should deploy and test it.

Branch lockedEvery authorized kiosk is assigned to one branch.
Privacy firstNo raw camera image is uploaded or retained.
Two modesEmployee-ID verification or opt-in face-only identification.
Facial Attendance
Implementation Guide
Document version 1.0

Executive summary

The HRIS now includes an administrator-controlled facial-attendance kiosk on the login page. Administrators define the approved privacy policy, enroll employees, authorize a browser for one branch, and may separately enable face-only identification.

1:1Employee selects an enrolled branch record; only that template is checked.
1:NNo ID is entered; active templates in the kiosk branch are checked.
0 imagesRaw camera frames stored or uploaded by the feature.
Important legal and privacy boundaryTechnical safeguards support compliance, but they do not make a deployment lawful by themselves. The organization's DPO or legal/privacy officer must approve the real PIA, lawful basis, notice, necessity and proportionality assessment, fallback, retention, and employee-rights procedures. Face-only 1:N identification must be addressed explicitly.

Guide contents

1. Work completed3
2. How the system works4
3. Privacy and security5
4. Administration guide6
5. Employee kiosk guide7
6. Technical reference8
7. Performance and troubleshooting9
8. Testing and acceptance10

Design principles

Explicit activation

The feature is disabled by default. A policy approval gate must be completed before a device can be authorized.

Visible kiosk session

An operator opens the session once. It scans employees automatically and stops when the attendance window is closed.

Scoped matching

Face-only searches never compare against every company employee—only active enrollments in the assigned branch.

Safe rejection

Low-quality, spoof-like, below-threshold, and ambiguous matches fail without guessing or revealing candidates.

Section 1
Delivery summary
What was implemented

Work completed

1

Tailwind administration page

Policy management, DPO approval, thresholds, device authorization, enrollment, revocation, status summaries, and audit visibility.

2

Login-page kiosk

A clean modal available only to an authorized browser, with privacy notice, fallback, camera guidance, and punch confirmation.

3

Encrypted enrollment

Face embeddings are generated in the browser and encrypted with AES-256-GCM before database storage.

4

Face-only identification

Optional 1:N matching removes employee-ID entry while retaining company, brand, branch, threshold, and ambiguity boundaries.

5

Authorized kiosk devices

Random, expiring, revocable browser credentials stored as hashes and delivered in protected cookies.

6

Attendance integration

Successful matches write into the existing attendance schedule, late, undertime, and credit calculations.

7

Retention automation

A scheduled command erases expired biometric ciphertext and removes old challenges and verification events.

8

Performance tuning

Background preload, face-only warm-up, lighter camera input, model caching, and a slower eye-close action improve kiosk reliability.

Controls added to the admin policy

ControlPurposeDefault
Main enablementTurns facial attendance on for the selected brand.Off
Face-only identificationAllows branch-scoped matching without employee ID.Off
Similarity thresholdMinimum score required for a face match.0.55
Ambiguity marginMinimum lead of best candidate over second best.0.08
Liveness / anti-spoofMinimum assurance scores accepted by the server.0.60 / 0.60
RetentionDefines expiry for templates and verification events.365 days
Access pointAdministrators open Settings → Facial Attendance. Authorized employees use the facial-attendance panel on the login page after the admin logs out.
Section 2
Processing flow
How it works

How the system works

Enrollment

1. ExplainShow notice and fallback
2. CaptureGenerate embedding locally
3. AssureCheck live person and spoof score
4. EncryptAES-256-GCM at server
5. RetainSave expiry and audit

An enrollment belongs to the employee's company, brand, and assigned branch. Re-enrollment revokes the former template and erases its ciphertext.

Face-only attendance

1. StartOpen kiosk session once
2. VerifyEye-close, liveness and anti-spoof
3. ChallengeUse device-bound one-time token
4. MatchSearch assigned branch only
5. PunchRecord server time

Decision rules

CheckAccepted whenFailure behavior
DeviceToken is valid, active, unexpired, and branch-bound.Kiosk panel is unavailable or request is denied.
ChallengeHash, device, expiry, and unused state are valid.Request is rejected; token cannot be replayed.
Live personEye-close signal and configured assurance scores pass.Employee is told to retry or use fallback.
SimilarityBest score meets the configured threshold.No employee identity is disclosed.
AmbiguityBest score leads the second result by the margin.System refuses to guess.
DuplicateNo accepted punch for employee/device in prior 60 seconds.Duplicate punch is rejected.

Attendance slot order

Morning inMorning outAfternoon inAfternoon out

The first empty slot is filled. The system then recalculates the existing schedule, rendered time, lateness, undertime, deductions, and credited days.

Section 3
Protection model
Privacy & security

Privacy and security controls

Data minimization

  • Camera frames are processed locally in the browser.
  • Raw photographs are not uploaded or stored.
  • The submitted numerical embedding is not written to event logs.
  • Rejected 1:N scans do not disclose nearby candidates.
  • The camera operates only while the visible automatic kiosk session is open.

Access boundaries

  • Admin functions require an authorized admin role.
  • All administration is scoped to the selected brand.
  • A kiosk is assigned to one branch.
  • Device credentials expire and can be revoked remotely.
  • Cross-origin requests require an exact configured HTTPS origin.

Credential and template protection

ItemProtection
Kiosk token32 random bytes; only SHA-256 hash stored; raw token delivered in an HttpOnly cookie.
Same-origin cookieSameSite=Strict; secure flag applied when HTTPS is detected.
Approved cross-origin cookieExact allowlisted HTTPS origin with Secure; SameSite=None.
Face templateAES-256-GCM ciphertext with separate IV and authentication tag.
ChallengeRandom secret represented by a stored SHA-256 hash; expires after two minutes and is one-use.
EventStores decision metadata and scores, not raw frames or embeddings.
Do not weaken thresholds to hide errorsA lower threshold may reduce false rejections while increasing false acceptance. Changes must be evaluated using representative staff, actual kiosk cameras, different lighting, and documented acceptance criteria.

Retention

The daily purge cryptographically erases expired templates, removes challenges expired for more than one day, and deletes verification events according to each brand's configured retention. The non-biometric attendance record follows the organization's separate attendance policy.

Section 4
Operator procedure
Administration guide

Administration guide

A. Install and configure

  1. Verify the existing attendance schema.
  2. Run the idempotent facial-attendance installer.
  3. Create a dedicated encryption secret and place it in the ignored local privacy configuration.
  4. Use HTTPS for every production camera page.
  5. Schedule the retention command to run daily.
php backend/scripts/check_facial_attendance_prerequisites.php
php backend/scripts/install_facial_attendance.php
php backend/scripts/purge_facial_attendance_data.php

B. Approve and save the policy

  1. Select the intended brand.
  2. Open Settings → Facial Attendance.
  3. Enter the approved notice version/text, lawful-basis and PIA references, DPO contact, fallback, and retention.
  4. Set thresholds based on pilot evidence.
  5. Enable facial attendance, confirm DPO/legal approval, and save.
  6. Enable 1:N separately only if the approved material explicitly covers face-only identification.
Built-in validationThe notice requires at least 160 characters, fallback at least 40 characters, retention 1–3650 days, valid threshold ranges, non-placeholder policy content, an encryption key, and approval confirmation.

C. Enroll employees

  1. Select an active employee with an assigned branch.
  2. Explain the approved notice and usable fallback.
  3. Record acknowledgment and capture a live face under good lighting.
  4. Confirm that the admin page shows an active enrollment and expiry date.

D. Authorize a kiosk

  1. Use the physical browser that will operate as the kiosk.
  2. Enter a clear device name and select its actual branch.
  3. Choose an authorization period and activate the browser.
  4. Log out to expose the kiosk panel on the login page.
Section 5
End-user procedure
Employee kiosk guide

Employee kiosk guide

Face-only mode

  1. Open Facial attendance on the login page.
  2. Review the privacy notice if needed.
  3. Stand in front of the camera; the active session starts automatically.
  4. Keep one face centered and move close enough.
  5. Close both eyes for one second when prompted, then open them.
  6. Wait for the confirmed employee name and punch slot, then step away. After 2.5 seconds, the kiosk prepares for the next employee automatically.

Employee-ID mode

  1. Open Facial attendance.
  2. Select your enrolled record from the branch-scoped dropdown.
  3. Confirm the displayed employee.
  4. Start the secure face scan.
  5. Complete the eye-close instruction.
  6. Wait for server confirmation.

Camera positioning

Light from front

Avoid a bright window behind the employee. Use steady, even lighting.

One person

Keep other faces outside the camera square during the live scan.

Close enough

The face should occupy a useful part of the frame without being cut off.

The fallback is part of the systemIf the employee cannot or should not complete biometric scanning, follow the displayed non-biometric attendance instructions. Repeated scanning is not a substitute for a workable fallback.

Understanding messages

MessageMeaning and action
Center your faceNo single usable face is visible; adjust position.
Only one person may be visibleAsk others to move outside the camera view.
Move closerThe detected face is too small for dependable processing.
Close both eyesHold both eyes closed for about one second, then reopen.
Confidence stayed too lowImprove lighting, remove glare, retry once, or use fallback.
Could not identify confidentlyNo safe unique match was found; use fallback rather than guessing.
Section 6
Engineering map
Technical reference

Technical reference

Frontend modules

ModuleResponsibility
FacialAttendanceAdmin.jsxTailwind administration, policy, enrollment, devices, and audit UI.
FacialKioskPanel.jsxLogin-page panel, privacy notice, challenge, identification, and result flow.
FaceCapture.jsxCamera lifecycle, model status, capture action, and local error display.
facialEngine.jsHuman model preload, detection, face mesh, embedding, liveness, and anti-spoof.
public/face-models/Locally hosted model manifests and weights.

Backend modules

ModuleResponsibility
_common.phpValidation, encryption, similarity, kiosk cookie/origin, scope, and audit helpers.
device_status.phpDetermines whether the browser is an active kiosk and returns policy display data.
challenge.phpRate-limited, device-bound, short-lived one-use challenge creation.
punch.phpAssurance validation, 1:1 or 1:N matching, ambiguity rejection, and event recording.
attendance_apply.phpExisting attendance slot and schedule/penalty integration.
admin/Admin role gate, settings, device, enrollment, and revocation endpoints.

Database tables

facial_attendance_settingsfacial_attendance_devicesemployee_face_templatesfacial_attendance_challengesfacial_attendance_eventsfacial_attendance_audit

Important operational limits

Section 7
Support notes
Performance & troubleshooting

Performance and troubleshooting

Why the first scan can be slower

The first authorized kiosk visit loads and initializes approximately 10 MB of local face models. The implementation now begins this work in the background on the login page. Later scans in the same session reuse the initialized engine.

ProblemResolution
Employee dropdown appears1:N is off. The list includes only active facial enrollments in the kiosk branch. Enable 1:N separately to remove selection.
Feature is not installedRun php backend/scripts/install_facial_attendance.php.
Feature is not enabledComplete valid policy content, encryption, approval, and main enablement.
Branch selector is emptyConfirm an active branch belongs to the currently selected company and brand.
Cross-origin request deniedUse the Vite API proxy locally; in production allowlist only the exact HTTPS frontend origin.
Challenge could not be createdCheck PHP logs, migrations, device state, branch scope, and active enrollment.
Model loading is slowKeep the login page open briefly; verify static model responses and production caching.
Eye-close check times outClose both eyes for a full second; improve lighting and camera position.
Missing vite.svgClear old site data/service worker once and hard-refresh; dev PWA registration is disabled.

Performance changes made

Escalate persistent slowness with evidenceRecord kiosk CPU/GPU, browser version, camera resolution, model request timing, inference messages, lighting, and approximate seconds to first and subsequent scans. This distinguishes network loading from device inference and match-server latency.
Section 8
Release readiness
Testing & acceptance

Testing and acceptance

Verification already performed

Production acceptance checklist

Known limitations

Recommended rolloutBegin with a supervised pilot, preserve the fallback, monitor failures without pressuring employees, review demographic and environmental performance, and obtain final DPO/legal sign-off before broader production use.