Technical peers interested in model inference, confidence handling, and AI security trade-offs
Dog Breed Inference Stack
A portfolio writeup on combining a custom transfer-trained dog-breed classifier with base models, weighted confidence, and a low-confidence fallback design.
This portfolio note comes from an older dog-breed identifier on the previous site. The interesting part was not that it could guess a breed. The interesting part was the inference design: a custom transfer-trained model, comparison against public base models, weighted confidence, and a fallback path when confidence dropped below a threshold.
The old implementation was intentionally experimental. The new site keeps the architecture lesson and moves the runtime surface behind verified registered-member access, private previews, audit records, model manifests, and feature flags.
What The Stack Explored
The old page used a custom dog-breed classifier trained across 118 breed labels. It also compared its output with ResNet50 and EfficientNetB0 models, then calculated a weighted local confidence score.
The weighting was simple:
custom model: 0.6
EfficientNetB0: 0.3
ResNet50: 0.1
low-confidence threshold: 0.6
That is not a claim that this is the ideal ensemble strategy. It is more useful than that: it shows the practical messiness of model decision design. Different models produce different label spaces, confidence scores are not automatically comparable, and a neat-looking final answer can hide a lot of uncertainty.
uploaded image
-> input validation and preprocessing
-> custom transfer-trained classifier
-> EfficientNetB0 comparison
-> ResNet50 comparison
-> label mapping and weighted confidence
-> low-confidence fallback decision
-> final result with caveats
Transfer Learning And Label Boundaries
The custom model used a ResNet50-style transfer-learning approach and was trained for a fixed set of 118 dog breeds. That fixed label set is important. If the input dog is outside the trained classes, the model still has pressure to pick the closest known class unless the surrounding logic handles uncertainty honestly.
That is one of the best lessons from the project: classification systems need a refusal path. A model that always answers can look confident while being wrong. In security terms, that is a failure mode, not a feature.
Confidence Is Design, Not Decoration
The old stack used weighted confidence to combine local model outputs. That made the result more interesting, but it also exposed a deeper issue: confidence needs calibration and governance.
For a production-grade version, I would want:
- Clear label taxonomy and model ownership.
- Calibration testing across representative image sets.
- Out-of-distribution handling.
- A defined "unknown" or "insufficient confidence" state.
- Logged model versions and inference decisions.
- Reviewable thresholds tied to the purpose of the system.
Without those controls, confidence can become theatre. With them, confidence becomes part of the evidence chain.
Fallback Trust Boundary
The old design could call a secondary vision-capable assistant when local confidence was low. That is a good architectural conversation and a poor thing to hide behind a glossy demo.
The moment a fallback system is introduced, the trust boundary changes:
- The image leaves the local model path.
- The fallback model may use a different taxonomy.
- The answer may be persuasive without being more correct.
- Privacy, retention, and cost controls become part of the design.
- Audit records need to distinguish local inference from fallback inference.
In a professional system, fallback is not magic. It is another dependency with its own assurance case.
Why This Matters For Security Architecture
This project belongs in the Portfolio because it demonstrates the kind of thinking AI security requires:
- Understand the limits of the model before presenting its output.
- Make uncertainty visible to the user.
- Treat uploads as hostile input until proven otherwise.
- Separate experimentation from public service exposure.
- Avoid turning a fallback model into an unexamined authority.
- Keep model files, prompts, thresholds, and results auditable.
The same lessons apply far beyond dog-breed identification. Any AI-assisted security workflow that classifies incidents, enriches alerts, labels risk, or proposes action needs the same discipline: bounded purpose, explicit uncertainty, secure input handling, and evidence that leaders and operators can trust.
Current Rebuild Boundary
The current Portfolio page is public. The live Dog Breed model test is private to verified
registered members when enabled. It does not add TensorFlow or Keras as web-app dependencies; model
execution stays inside the separate inference service. Runtime model binaries stay outside Git under
model-artifacts/.
The old external AI fallback is not active in this rebuild. Low-confidence local results are shown with caveats rather than silently handing the image to another model. That is the important security boundary: the demo can be useful without pretending uncertainty has disappeared.
Runnable model
Run the controlled Dog Breed model
The architecture and confidence-handling lessons remain public. Registered members can test the local inference stack when the Dog Breed feature flag is enabled: custom model, EfficientNetB0, ResNet50, weighted confidence, private previews, and audit records. Previously the fallback was ChatGPT, but this is disabled at this point in time.