import dash from dash import html import dash_bootstrap_components as dbc dash.register_page(__name__, path="/problem", name="The Problem") layout = html.Div([ html.Div([ html.H1("The Problem", className="text-white fw-bold mb-2"), html.P("Why engine fault detection needs machine learning, not rules.", className="lead text-info"), ], className="mb-5"), dbc.Card(dbc.CardBody([ html.H3("What counts as normal depends on context", className="text-white mb-3"), html.P([ "A naive detector that flags 'high RPM' or 'high pressure' would fire every time the " "driver accelerates. The same reading can be perfectly healthy or a warning sign " "depending on what the rest of the engine is doing." ], className="text-light mb-3", style={"fontSize": "1.1rem", "lineHeight": "1.8"}), html.P([ "Writing rules for every combination of RPM, load, temperature and throttle is " "impossible - the relationships are continuous and multi-dimensional. This is exactly " "the situation where a model that ", html.B("learns the shape of normal"), " outperforms hand-written thresholds." ], className="text-light", style={"fontSize": "1.1rem", "lineHeight": "1.8"}), ]), className="modern-card mb-4"), dbc.Row([ dbc.Col(dbc.Card(dbc.CardBody([ html.I(className="bi bi-eye-slash fs-2 text-success mb-2"), html.H4("Faults are rare", className="text-white"), html.P("A well-maintained engine runs thousands of hours between failures. The data is " "almost entirely healthy, so we cannot rely on labeled fault examples.", className="text-light"), ]), className="modern-card h-100"), md=6, className="mb-4"), dbc.Col(dbc.Card(dbc.CardBody([ html.I(className="bi bi-shuffle fs-2 text-success mb-2"), html.H4("Faults are diverse", className="text-white"), html.P("Injector clogging, seal leaks, pump wear, sensor drift - each looks different. " "We cannot enumerate them all, so we learn 'normal' and flag everything else.", className="text-light"), ]), className="modern-card h-100"), md=6, className="mb-4"), ]), dbc.Card(dbc.CardBody([ html.H3("The unsupervised philosophy", className="text-white mb-3"), html.P([ "Instead of asking ", html.I("'does this look like fault X, Y or Z?'"), " we ask ", html.I("'does this look like anything I saw when the engine was healthy?'"), " Anything that does not fit the learned normal pattern is flagged - including faults " "the model has never seen before." ], className="text-light mb-3", style={"fontSize": "1.1rem", "lineHeight": "1.8"}), html.Div([ html.Span("Train", className="badge bg-secondary me-2 p-2"), html.I(className="bi bi-arrow-right text-muted mx-2"), html.Span("Learn the shape of healthy driving", className="text-light me-3"), ], className="mb-2"), html.Div([ html.Span("Detect", className="badge bg-success me-2 p-2"), html.I(className="bi bi-arrow-right text-muted mx-2"), html.Span("Flag readings that no longer fit that shape", className="text-light"), ]), ]), className="modern-card mb-4"), ])