AEGIS Bilingual Industrial Action Classifier is an English-Arabic controlled industrial-action classification prototype built on bigscience/mt0-small using LoRA/PEFT.
It was developed as part of AEGIS AI, an industrial intelligence portfolio platform for manufacturing, robotics, warehouses, logistics, and related operational environments.
Instead of generating unrestricted operational instructions, the model selects one of eight predefined action classes from operational evidence and a question.
The selected class is then mapped deterministically to an approved English or Arabic response.
Key Features
English and Arabic industrial classification
bigscience/mt0-small base model
LoRA / PEFT fine-tuning
Eight controlled industrial action classes
Single-token numeric classification targets
Candidate scoring across all eight classes
Deterministic approved-response rendering
Free-form operational action generation disabled
FastAPI backend integration
React frontend integration
CPU-trained portfolio prototype
Architecture
The AEGIS inference architecture is:
text
1Operational Evidence
2 +
3Industrial Question
4 +
5Language (EN / AR)
6 |
7 v
8bigscience/mt0-small
9 +
10AEGIS LoRA Adapter
11 |
12 v
13Candidate scoring over
14single-token codes 0-7
15 |
16 v
17Selected Class Code
18 |
19 v
20Semantic Action ID
21 |
22 v
23Deterministic Approved
24English / Arabic Response
The model therefore functions as a controlled classifier, not as an unrestricted industrial chatbot.
Free-form operational action generation is disabled.
Controlled Action Classes
Code
Semantic Action ID
Industrial Module
0
ALERT_ESCALATION
AI Alerts
1
DOCUMENT_GROUNDED_ANSWER
Document Assistant
2
FACTORY_DEGRADED_REVIEW
Factory Status
3
PREDICTIVE_MAINTENANCE
Predictive Maintenance
4
ROBOT_SAFE_RESTART
Robot Monitoring
5
VISION_QUARANTINE
Vision Inspection
6
WORKER_SAFETY_STOP
Worker Safety
7
WORK_ORDER_CREATE
Workflow Automation
The complete English and Arabic mappings are provided in:
class_code_map.json
Approved Actions
0 — ALERT_ESCALATION
English
Acknowledge, assess severity, and escalate according to the alert playbook.
Arabic
أكد استلام التنبيه، وقيّم مستوى الخطورة، وصعّد الحالة وفق دليل إجراءات التنبيهات.
1 — DOCUMENT_GROUNDED_ANSWER
English
Answer only from approved evidence and cite the source.
Arabic
أجب فقط استنادًا إلى الأدلة المعتمدة، واذكر المصدر.
2 — FACTORY_DEGRADED_REVIEW
English
Review line KPIs and investigate the assets driving the degraded status.
Arabic
راجع مؤشرات الأداء الرئيسية (KPIs) لخط الإنتاج، وتحقق من الأصول المتسببة في تدهور الحالة.
3 — PREDICTIVE_MAINTENANCE
English
Inspect the asset, confirm the trend, and schedule maintenance before failure.
Arabic
افحص الأصل، وتأكد من اتجاه التدهور، وجدول أعمال الصيانة قبل حدوث العطل.
4 — ROBOT_SAFE_RESTART
English
Diagnose the protective stop and verify safe conditions before restart.
Arabic
شخّص سبب التوقف الوقائي، وتحقق من توفر ظروف آمنة قبل إعادة التشغيل.
5 — VISION_QUARANTINE
English
Quarantine the suspect item and send it for secondary inspection.
Arabic
اعزل العنصر المشتبه به وأرسله لإجراء فحص ثانوي.
6 — WORKER_SAFETY_STOP
English
Stop unsafe work, secure the area, and follow the approved safety procedure.
Arabic
أوقف العمل غير الآمن، وأمّن المنطقة، واتبع إجراء السلامة المعتمد.
7 — WORK_ORDER_CREATE
English
Create and track a work order with owner, priority, evidence, and closure verification.
Arabic
أنشئ أمر عمل وتابعه مع تحديد المسؤول، والأولوية، والأدلة، والتحقق من الإغلاق.
Dataset
Training dataset:
syed7741/aegis-bilingual-industrial-ai-dataset
The dataset contains 64 unique synthetic industrial records across eight operational modules.
Languages:
English
Arabic
The final experiment used:
Dataset Property
Value
Unique records
64
Training records
48
Held-out records
16
Training records per module
6
Held-out records per module
2
Expanded training examples
192
Bilingual evaluation examples
32
Approved action classes
8
The record-level train/evaluation split was performed before prompt expansion.
The dataset design also includes:
evidence-aligned examples
module labels removed from questions
target-leakage checks
balanced module representation
bilingual English-Arabic evidence
Training Configuration
Setting
Value
Base model
bigscience/mt0-small
Architecture
MT0 + LoRA
Epochs
10
Learning rate
5e-4
Batch size
1
Gradient accumulation steps
4
Maximum input length
512
LoRA rank
8
LoRA alpha
16
LoRA dropout
0.05
LoRA target modules
q, v
Trainable parameters
344,064
Total parameters
300,520,832
Trainable percentage
~0.1145%
Training hardware
CPU
PyTorch
2.13.0+cpu
Transformers
5.15.0
PEFT
0.19.1
Initial evaluation loss:
2.760820
Final evaluation loss:
0.004219
Total recorded training time:
1004.12 seconds
Approximately:
16.7 minutes
Held-Out Evaluation
The final model was evaluated using a balanced set of 16 held-out records.
Every held-out record was tested in both English and Arabic.
This produced:
32 classification tests
Results
Language
Correct
Total
Accuracy
English
16
16
100%
Arabic
16
16
100%
Combined
32
32
100%
Each of the eight industrial modules contained two held-out records.
For every module, the classifier achieved:
text
1English: 2 / 2
2Arabic: 2 / 2
3Combined: 4 / 4
The detailed benchmark results are available in:
controlled_action_evaluation.json
Important Benchmark Interpretation
The 100% accuracy result applies only to this specific small, balanced, synthetic held-out benchmark.
It does not mean that the model has 100% accuracy in:
real factories
refineries
warehouses
logistics facilities
robotics deployments
real worker-safety incidents
real predictive-maintenance environments
other unseen industrial conditions
No real-world industrial safety certification, regulatory validation, or field-validation claim is made.
The benchmark demonstrates successful controlled classification on the project's synthetic evaluation set.
Why Single-Token Numeric Classes?
Earlier AEGIS experiments used long semantic labels such as:
These labels tokenize into different sequence lengths.
For a sequence-to-sequence model, unequal label lengths can introduce undesirable generation and scoring behavior.
The final architecture therefore uses:
text
10
21
32
43
54
65
76
87
Each class code is represented as a single tokenizer token.
The numeric code is then mapped deterministically to the corresponding semantic industrial action.
This separates:
Model Classification
from:
Operational Response Rendering
Candidate Scoring
The AEGIS runtime does not rely on unrestricted text generation to decide the operational action.
Instead:
A bilingual prompt is constructed from evidence, question, language, and the approved action menu.
The prompt is passed through MT0 + the LoRA adapter.
All eight candidate codes are evaluated.
A loss value is calculated for every candidate.
The candidate with the lowest loss is selected.
The code is mapped to a semantic action ID.
The final response is loaded from the approved action catalog.
Conceptually:
text
1Evidence + Question
2 |
3 v
4Score class 0
5Score class 1
6Score class 2
7Score class 3
8Score class 4
9Score class 5
10Score class 6
11Score class 7
12 |
13 v
14Lowest Loss
15 |
16 v
17Selected Action
Controlled Response Design
The final operational response itself is not generated freely by the model.
For example:
Predicted class: 6
maps to:
WORKER_SAFETY_STOP
which maps to the approved English response:
Stop unsafe work, secure the area, and follow the approved safety procedure.
or the approved Arabic response:
أوقف العمل غير الآمن، وأمّن المنطقة، واتبع إجراء السلامة المعتمد.
This architecture was chosen to demonstrate a controlled-output design for an industrial AI prototype.
Example — English
Evidence
text
1An unsafe condition has been confirmed around CONV-02.
2Personnel are still performing work near the hazard,
3access to the affected area remains open, and required
4safety controls have not yet been completed.
Question
text
1Based on the operational evidence, what action should be
2taken for CONV-02?
Selected class
6
Semantic action
WORKER_SAFETY_STOP
Approved response
Stop unsafe work, secure the area, and follow the approved safety procedure.
Example — Arabic
الأدلة التشغيلية
text
1تم تأكيد وجود حالة غير آمنة بالقرب من المعدة CONV-02.
2لا يزال بعض العاملين يواصلون العمل بالقرب من مصدر الخطر،
3كما أن الوصول إلى المنطقة المتأثرة ما زال مفتوحًا ولم تكتمل
4ضوابط السلامة المطلوبة بعد.
السؤال
استنادًا إلى الأدلة التشغيلية، ما الإجراء الذي ينبغي اتخاذه للمعدة CONV-02؟
الفئة المختارة
6
Semantic Action ID
WORKER_SAFETY_STOP
الإجراء المعتمد
أوقف العمل غير الآمن، وأمّن المنطقة، واتبع إجراء السلامة المعتمد.