Evaluate alert decisions on a labelled held-out teaching fixture.
The focus of this experiment is to interpret alert decisions from labeled synthetic observations. Students then calculate precision, recall and false-positive behavior, and evaluate threshold trade-offs under the stated data distribution. The Concepts view explains the operation before the practical work; the Simulation view is used to examine reference and changed inputs, not to substitute for actual measurements.
Learning objectives
Interpret alert decisions from labeled synthetic observations.
Calculate precision, recall and false-positive behavior.
Evaluate threshold trade-offs under the stated data distribution.
Identify the configured inputs (Alert score threshold (0–100)) and record the corresponding observed outputs with units where applicable.
Compare the reference calculation or decision with an independent implementation or authorized observation; state any discrepancy and the applicable model boundary.
Expected learning outcomes
On completion, students can interpret alert decisions from labeled synthetic observations, calculate precision, recall and false-positive behavior, and evaluate threshold trade-offs under the stated data distribution.
Required deliverables
Submit the derivation or state trace for the named operation, the exact reference and changed configurations, the associated simulator or practical evidence, and a short validation statement addressing evaluate threshold trade-offs under the stated data distribution. Separate predicted values from observations.
Prerequisite knowledge and related learning
Review the following catalogue prerequisites before starting. After completion, continue to Incident correlation & response timeline.
The specified isolated laboratory environment, with local synthetic inputs and authorized services only. Use the experiment-specific setup and verification instructions.
Begin with a manual prediction, record the baseline, change one independent condition at a time, and compare the resulting trace or measurements with the original prediction. Record observations and uncertainty separately from reference values. Follow the experiment’s specific procedure, safety limits, and acceptance checks.
Scientific concept map: Observed traffic — Features and labels; Detector — Anomaly score; Threshold — Alert decision; Confusion matrix — Ground truth comparison; Quality — Precision / recall.
Scientific foundations and analytical reasoning
A detection score threshold trades false positives and false negatives. Ground truth defines TP/FP/TN/FN.
Before operating the equipment or executing the program, derive the expected outcome using the required theoretical work in Experiment. Use the diagram to identify the variables and system boundaries.
Scientific theory · Alert performance and thresholding
A detection score is converted into an alert by a threshold. A confusion matrix compares alerts with independent labels: false positives are normal records flagged, false negatives are actual faults missed. Precision and recall describe complementary aspects; false-positive rate uses the number of actual negatives.
Worked example and engineering interpretation
For FP=5 and TN=95, false-positive rate is 5%. If TP=15 and FN=5, recall=75%. Raising a threshold can reduce both false and true positives; select the operating point using stated operational costs and validation data.
Engineering principles · additional worked teaching example
An alert system has true and false positives and negatives. Precision concerns alert correctness, recall concerns actual event coverage. High false alarm rate may overload operators despite high recall.
From theory to experiment
Predict the reference result before operating the workbench; check the actual intermediate state, units and constraints. The existing simulation, implementation and procedure below are distinct sources of evidence.
How to investigate Intrusion detection & alert quality
Evaluate alert decisions on a labelled held-out teaching fixture.
Analytical investigation means collecting an observation, identifying the mechanism, using a calculation or state trace to explain it, and checking your conclusion against evidence. Controlled comparison means changing one independent variable, holding the remaining relevant conditions constant, and measuring a dependent variable against a baseline. Experimental validation means comparing a predicted result to a reproducible observation or assertion; agreement inside a model does not certify hardware. Evidence-based reasoning connects a specific observation to a theoretical rule and states uncertainty, not merely an opinion. Performance characterization records a named metric and its units across conditions; sensitivity analysis changes one parameter across several values. A threat assessment links an asset, threat, consequence and evidence to a mitigation.
Experiment-specific guided practice
Objective: Evaluate alert decisions on a labelled held-out teaching fixture.
Set Alert score threshold (0–100) = 60. Observe the calculated results and trace.
Change Alert score threshold (0–100) = 80. Raising the threshold reduces or preserves alert count; recall cannot increase.
Restore the reference values. Use the M03 Edge AI lab to review confusion matrices. Explain why tuning on this fixture is not independent validation.
Reference check:
Model boundary:
Independent task and submission evidence
2. Change Alert score threshold (0–100) = 80. Raising the threshold reduces or preserves alert count; recall cannot increase. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.
Before execution write the independent variable and its levels, dependent observation with units where applicable, baseline, controlled variables, measurement method and expected result. For a state machine use state/event/output rather than inventing a numeric metric. Record failures and repeat the baseline. A weak conclusion is “it works”; a supported conclusion names the changed setting, observed value/state, corresponding rule and one limitation.
Trial
Changed setting
Fixed settings
Predicted result
Actual observation / units
Evidence / uncertainty
A: baseline
Reference
Record
Predict
Record
Record
B: one change
Record
Same as A
Predict
Record
Record
A: repeat
Restore
Same as A
Predict
Record
Record
Completion: submit the filled table, relevant simulator screenshot or terminal/notebook output, reasoning with units/assumptions, and one limitation. Preserve the independent assessment questions; this guide does not fill their answers.
Evaluate alert decisions on a labelled held-out teaching fixture.
Method: Threshold a fixed 12-event score trace; calculate TP, FP, TN, FN, precision, recall and FPR; undefined ratios are shown as N/A.
Closed teaching fixture only. No external devices, sockets, scanning, exploits or real credentials. Browser decisions are not measurements of deployed controls.
Worked engineering reasoning and boundary conditions
Engineering reference configuration: Alert score threshold (0–100) = 60. In the classroom model, TP = 4; FP = 2; TN = 4; FN = 2; PRECISION = 0.666667; RECALL = 0.666667. Fixed labelled scores are not packet captures or a trained IDS. Threshold tuning and final evaluation must use different datasets. Threshold a fixed 12-event score trace; calculate TP, FP, TN, FN, precision, recall and FPR; undefined ratios are shown as N/A.
Use the diagram to follow the calculation or state progression. Keep the teaching configuration separate from the independent exercise values; compare observations with the actual model and implementation.
Concept animation · progressive data plot
Explore the teaching example independently of the simulator. Each step reveals an operation, data relationship or calculated state. The Simulation view has separate editable inputs.
Step 1 of 7 · Observation Event 1
Observation Event 1
Score
10
Threshold
60
Observation Event 3
Score
42
Threshold
60
Observation Event 5
Score
67
Threshold
60
Observation Event 7
Score
35
Threshold
60
Observation Event 8
Score
59
Threshold
60
Observation Event 10
Score
73
Threshold
60
Observation Event 12
Score
96
Threshold
60
Teaching example only; inspect live calculations or real practical evidence separately.
Recall the concept before revealing its explanation.
0 / 3 revealed
S05 · 01 / 08What observations are used to evaluate alert decisions?Reveal explanation
Engineering explanation
Evaluate alert decisions on a labelled held-out teaching fixture.
S05 · 02 / 08How is the intrusion detection decision modeled?Reveal explanation
Engineering explanation
Threshold a fixed 12-event score trace; calculate TP, FP, TN, FN, precision, recall and FPR; undefined ratios are shown as N/A.
S05 · 03 / 08What should happen to detection counts when the threshold changes?Reveal explanation
Engineering explanation
Raising the threshold reduces or preserves alert count; recall cannot increase.
S05 · 04 / 08Why does a lower IDS alert threshold often raise false alarms?Reveal explanation
Engineering reasoning
More scores exceed the threshold, including some normal cases.
They use different denominators: predicted positives versus actual negatives.
S05 · 06 / 08An intrusion detector is evaluated on labeled cases. Select every technically valid statement.
A. Compute false positives and false negatives separately.
B. Report the selected threshold and held-out evaluation provenance.
C. Zero false positives necessarily means all attacks were detected.
D. Threshold selection on the held-out labels is an untouched evaluation.Reveal explanation
Applied scenario
Correct: A. Compute false positives and false negatives separately.; B. Report the selected threshold and held-out evaluation provenance.
S05 · 07 / 08In Intrusion detection & alert quality, which reference and changed settings are prescribed for Alert score threshold (0–100)?Reveal explanation
Controlled configuration
Alert score threshold (0–100): 60 → 80; hold the remaining settings fixed.
S05 · 08 / 08What expected result distinguishes the reference and changed trials in Intrusion detection & alert quality?Reveal explanation
Expected observation
Raising the threshold reduces or preserves alert count; recall cannot increase.
Interactive networking and security instrument
Loading experiment-specific apparatus…Previous model / additional reference tools
Simulation task
Evaluate alert decisions on a labelled held-out teaching fixture.
Explore the model using its own controls. Record a prediction before changing a condition. Compare the reference with a changed condition, then use the Experiment tab for the procedure, acceptance criteria and notebook. Model outputs and physical observations must remain separate.
Interactive engineering workbenchS05 · Existing model
Readout from the original computational model; not physical measurements.
Loading instrument…
Awaiting model display.
Experimental instrumentation · A/B
Compare two model conditions
Capture a baseline, change one experimental condition, run the model if required and capture the comparison. Snapshots contain visible controls and display text, not physical sensor readings. Review before exporting.
Ask Dr. Mohammad locally, or prepare an experiment-aware prompt for ChatGPT, Gemini or Claude. The external providers open in their own tabs; nothing is automatically submitted.
Public course objective, displayed commands, source excerpts and procedure. Private assessment content is not collected.
Prepare a contextual AI prompt
0 characters
Common secret and email patterns are redacted on preparation; this is not a comprehensive privacy filter. Review the entire editable prompt, including student work and unpublished research, before sharing. The providers apply their own accounts, privacy settings and limits.
Prepare → review → copy & open your selected provider → paste and submit there.
Independent theoretical exercises
Before the simulation or practical, solve both experiment-specific tasks. List the given inputs, show the intermediate calculation or state trace, identify the expected observation, and state a limitation. Show formulas and intermediate calculations where relevant, or draw the requested state/sequence diagram. These are independent classroom fixtures; where they differ from the reference configuration below, do not treat them as measured values. Compare your predictions with the corresponding experiment afterwards.
01 · Predict and derive using the given inputs
For scores 20,55,60,70,90 and labels 0,1,0,1,1, compute confusion matrices for threshold60 and 75 with ≥ rule.
Engineering method — An alert system has true and false positives and negatives. Precision concerns alert correctness, recall concerns actual event coverage. High false alarm rate may overload operators despite high recall. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
02 · Compare or justify using evidence
Compute precision, recall and FPR; discuss threshold selection on validation data rather than test labels.
Engineering method — An alert system has true and false positives and negatives. Precision concerns alert correctness, recall concerns actual event coverage. High false alarm rate may overload operators despite high recall. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
03 · Calculation
Calculation · Independent work
TP=18,FP=12,FN=2,TN=68. Derive precision, recall and false-positive rate.
Calculation — An alert system has true and false positives and negatives. Precision concerns alert correctness, recall concerns actual event coverage. High false alarm rate may overload operators despite high recall. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
Work is saved locally when browser storage is available. Export it for submission; no remote upload or automatic grade is assigned.
Expanded independent theoretical exercise bank
Progress from calculation and interpretation to diagnosis and controlled engineering design. Complete the questions without opening the simulation first; show intermediate steps.
Intermediate · Explain a changed-input result
Independent theoretical exercise · S05-01
Use the reference configuration (Alert score threshold (0–100) = 60), but change Alert score threshold (0–100) = 58. The model reports TP = 5. Explain the governing rule and assumptions that make this output plausible; identify an independent verification method.
Intermediate · Quantitative comparison
Independent theoretical exercise · S05-02
Two model observations of TP are 4 (reference) and 5 (changed condition). Compute signed change and, when the reference is nonzero, percentage change. Explain why units matter.
Intermediate · Interpret a technical trace
Independent theoretical exercise · S05-03
For Alert score threshold (0–100) = 80, the model supplies this excerpt from Calculated trace:
Item | Value | Explanation
Event 1 | score 10 · actual normal · no alert | —
Event 2 | score 25 · actual normal · no alert | —
Event 3 | score 42 · actual normal · no alert | —
Event 4 | score 58 · actual normal · no alert | —
Event 5 | score 67 · actual normal · no alert | —
Count rows whose Value value is exactly “score 10 · actual normal · no alert”, and identify the displayed row numbers. Explain what the count describes.
Advanced · Reverse reasoning
Independent theoretical exercise · S05-04
An observation is TP = 2. Candidate A uses Alert score threshold (0–100) = 60. Candidate B changes the listed settings (Alert score threshold (0–100) = 80) and keeps the remaining settings fixed. Which is consistent with the observation? If both can explain it, say what additional evidence is required.
Advanced · Diagnose a reported mismatch
Independent theoretical exercise · S05-05
A student configures Alert score threshold (0–100) = 80 while preserving all other reference settings, but copies the reference report of TP = 4. Evaluate whether the report is justified. Identify the first configuration/output check to perform.
Challenging · Design a controlled verification
Independent theoretical exercise · S05-06
Design a controlled comparison for Intrusion detection & alert quality using reference Alert score threshold (0–100) = 60 and test Alert score threshold (0–100) = 58. Specify the changed setting(s), measured metric TP, controls, repetitions, an acceptance check and what evidence can distinguish an actual implementation from the model.
Step-by-step experimental procedure
Evaluate alert decisions on a labelled held-out teaching fixture.
1 · Reference workbench configuration
Use the named reference workbench and its reference inputs. Additional live instruments may have different controls; use the matching instrument. Record virtual and practical results separately.
Alert score threshold (0–100)60
2 · Perform the investigation in order
Set Alert score threshold (0–100) = 60. Observe the calculated results and trace.
Change Alert score threshold (0–100) = 80. Raising the threshold reduces or preserves alert count; recall cannot increase.
Restore the reference values. Use the M03 Edge AI lab to review confusion matrices. Explain why tuning on this fixture is not independent validation.
3 · Compare controlled trials
Trial
Independent change
Expected check
Observation
Reference
Use reference inputs above
Raising the threshold reduces or preserves alert count; recall cannot increase.
Record actual result
Controlled change
Alert score threshold (0–100) = 80
Raising the threshold reduces or preserves alert count; recall cannot increase.
Record actual result
4 · Analyze and report
Use the M03 Edge AI lab to review confusion matrices. Explain why tuning on this fixture is not independent validation.
Required evidence: Record the intrusion detection & alert quality comparison and justify the changed outcome from the calculated trace.
Model boundary: Threshold a fixed 12-event score trace; calculate TP, FP, TN, FN, precision, recall and FPR; undefined ratios are shown as N/A.
Controlled investigation · reproducible evidence
Method. Use the existing reference workbench configuration and the named controlled changes below. A controlled variable stays fixed while the independent variable is intentionally changed; the dependent variable is the resulting observed output. First predict each trial from the Concepts page. Run the baseline, then change only the specified setting and record the outcome. For deterministic traces one execution per case and a repeated verification are sufficient; for timing or stochastic measurements repeat at least five times, recording each run, median and range. Reset to the reference state between independent comparisons.
Trial
Independent change
Dependent observation
Reference
Use reference inputs above
Record actual outcome and units
Controlled change
Alert score threshold (0–100) = 80
Record actual outcome and units
Evidence: attach the completed comparison table, one trace or screenshot per condition, and actual practical terminal/hardware evidence where applicable. Explain any prediction mismatch and distinguish modeled behavior from measured results.
Loading laboratory-specific procedure…
Python / Google Colab notebook
Original closed defensive reference model; no external targets. Validated locally in a fresh Jupyter kernel. Download, then upload to Google Colab.
Download this notebook and open Google Colab. Select File → Upload notebook and choose the downloaded .ipynb.
Read the Markdown instructions before each executable cell. Use a Python runtime, run cells from top to bottom, and resolve imports if necessary.
Perform the baseline and controlled changes. Save the notebook with actual outputs and your written interpretation.
Execution scope: Default computational cells passed isolated local Python execution; physical equipment and live services require separate verification.
01Instructions · Markdown
# s05 · Intrusion detection & alert quality
**PSUT IoT Engineering Studio — Dr. Mohammad Alja’afreh**
## Introduction
Evaluate alert decisions on a labelled held-out teaching fixture.
## How to run
1. Download this notebook from the laboratory page. Open Google Colab → File → Upload notebook.
2. Select a Python CPU runtime. Run cells from top to bottom using Shift+Enter, or Runtime → Run all.
3. Read the printed observations and assertions. Change one parameter at a time and rerun the relevant cell.
4. Save your own outputs and compare them to the portal Experiment tab.
**Execution boundary:** Original closed defensive reference model; no external targets. Do not run the hardware or service commands in Colab. No real credentials are needed. The notebook is self-contained.
02Instructions · Markdown
## Experiment-specific preparation
Evaluate alert decisions on a labelled held-out teaching fixture.
**Reference procedure (use the matching simulator/WSL tool where named, not an unrelated service):**
1. Set Alert score threshold (0–100) = 60. Observe the calculated results and trace.
2. Change Alert score threshold (0–100) = 80. Raising the threshold reduces or preserves alert count; recall cannot increase.
3. Restore the reference values. Use the M03 Edge AI lab to review confusion matrices. Explain why tuning on this fixture is not independent validation.
**Evidence:**
**Boundary:**
03Instructions · Markdown
## 1. Objectives and reference condition
- Reproduce the specific computational mechanism in this laboratory.
- Inspect the output, compare the reference condition with a changed or rejected condition where implemented, and explain any discrepancy.
- Distinguish actual local Python execution from mock, physical and external-service observations.
## 2. Environment check
04Python · executable cell
PYTHON · Code cell
# =====================================================================
# S05 | Code cell 01 | Intrusion detection & alert quality
# Purpose: 1. Objectives and reference condition - Reproduce the specific computational mechanism in this laboratory. - Inspect the output, compare the reference condition with a changed or rejected condition where implem
# Inputs: the explicit fixture/settings below and any preceding cell state.
# Output: inspect printed values, returned records or assertions; record evidence.
# =====================================================================
import sys
print("Python",sys.version.split()[0])
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert sys.version_info >= (3,10)
## 3. Implementation
Read the comments and variable definitions before execution. Assertions must pass; inspect values, not just completion.
06Python · executable cell
PYTHON · Code cell
# =====================================================================
# S05 | Code cell 02 | Intrusion detection & alert quality
# Purpose: implement only the mechanism named in this laboratory.
# Inputs: the explicit fictional fixture and reference parameters below.
# Output: printed observations and assertions for the controlled trial.
# =====================================================================
# Synthetic labelled alert scores; threshold governs the predicted class.
normal=[10,25,42,58,67,85];incident=[35,59,63,73,88,96]
def evaluate(threshold):
fp=sum(s>=threshold for s in normal);tp=sum(s>=threshold for s in incident)
return {'tp':tp,'fp':fp,'tn':len(normal)-fp,'fn':len(incident)-tp,'precision':tp/(tp+fp) if tp+fp else None,'recall':tp/len(incident),'fpr':fp/len(normal)}
### Step 2 · Run the reference calculation
Read the comments and variable definitions before execution. Assertions must pass; inspect values, not just completion.
08Python · executable cell
PYTHON · Code cell
# =====================================================================
# S05 | Code cell 03 | Intrusion detection & alert quality
# Purpose: implement only the mechanism named in this laboratory.
# Inputs: the explicit fictional fixture and reference parameters below.
# Output: printed observations and assertions for the controlled trial.
# =====================================================================
for threshold in (40,60,80):print(threshold,evaluate(threshold))
assert evaluate(80)['fp']<=evaluate(40)['fp']
## Original portal implementation (reference only)
These are the actual laboratory snippets. They are retained for comparison; follow the portal setup for WSL, hardware or services. They are **not** executed by Run all.
```bash
python3 verification/sec169_practical.py all
```
10Instructions · Markdown
## 4. Results and analysis
Record the actual output and whether the assertions pass. Identify a parameter to vary, state your prediction, repeat the reference calculation, then explain the changed result.
| Trial | Configuration | Observation | Interpretation |
|---|---|---|---|
| A | Reference | | |
| B | One controlled change | | |
| C | Reference repeat | | |
**Limitations:** Original closed defensive reference model; no external targets. Notebook success does not certify external equipment or services.
11Instructions · Markdown
## Guided reasoning and evidence
A controlled comparison changes one independent input while keeping the other relevant inputs fixed; the dependent variable is the recorded output. Use this lab’s reference condition above.
**Independent task:** 2. Change Alert score threshold (0–100) = 80. Raising the threshold reduces or preserves alert count; recall cannot increase. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.
| Trial | Input/configuration | Prediction | Observation | Evidence / limitation |
|---|---|---|---|---|
| A | Reference | | | |
| B | Changed input | | | |
| A repeat | Reference | | | |
A conclusion is supported only when it cites the recorded values or observed states and explains them with the experiment theory.
Shared research workbenches · network designer & advanced studiesConcurrent-device simulation & Monte Carlo research