AI Aperture Estimation

Field

Detail

Product

MokuPhoto AI Aperture Estimation

Type

Internal tool — metadata enrichment pipeline

Scope

Algorithm design, lens registry, computer vision analysis, Framer component integration, validation framework

Stack

TypeScript, Claude Haiku Vision API, Framer React, Cloudflare R2

Camera System

OM System OM-3 + Olympus OM Zuiko 28mm f/3.5 (vintage manual mount via adapter)

Studio

Mokujiro Studio

Location

Melbourne, Australia

Timeline

June 2026

Meiji Jingu shrine gate photographed with the Zuiko 28mm f/3.5 vintage manual lens

The Problem

Vintage manual-focus lenses are a deliberate choice. The Olympus OM Zuiko 28mm f/3.5, designed in the 1970s, renders light in a way that modern optics don't replicate. It's slow. It has no coatings to speak of. And when mounted on the OM-3 via an adapter, it produces images with a character that can't be designed digitally.

But it creates a metadata problem.

The OM-3 body communicates with modern electronic lenses through electrical contacts on the mount. When a Panasonic Leica 15mm f/1.7 is attached, the camera knows the aperture, focal length, and focus distance at every moment. The EXIF data is accurate.

When the Zuiko 28mm is mounted via adapter, those contacts are absent. The camera cannot read the aperture ring. It records the lens's maximum aperture — f/3.5 — regardless of what the photographer actually set. A shot taken at f/11 is tagged f/3.5. A shot taken at f/16 is tagged f/3.5. Every image carries the same incorrect value.

For a portfolio that displays full shooting metadata alongside every photograph, this isn't a minor inconvenience. It's false data presented as fact.

Night photograph of Tokyo architecture shot with the Zuiko 28mm, showing deep depth of field characteristic of a stopped-down aperture

Approach

Lens Classification

The first step was to stop treating all lenses equally. A configurable lens registry was built to classify every lens the system encounters. Each profile records whether the lens supports electronic aperture communication, whether it supports electronic focus, its maximum aperture, and the set of candidate aperture values it can produce.

When a photograph enters the pipeline, the system looks up the lens name from EXIF, matches it against the registry, and classifies it as electronic or vintage manual. Electronic lenses pass through immediately — their aperture data is reliable. Vintage manual lenses are flagged for estimation.

The registry currently covers the full lens kit used across the MokuPhoto portfolio: the Panasonic Leica 15mm f/1.7, the M.Zuiko 12-45mm f/4 PRO, and the two vintage Zuiko primes (28mm f/3.5 and 50mm f/1.8). Adding a new lens requires a single registry entry — no algorithm changes needed.

Reliability Assessment

Before running any AI analysis, the system evaluates whether the recorded aperture can be trusted. This is not a binary yes/no. A vintage lens reporting f/3.5 is evaluated differently depending on context:

If the recorded value matches the lens's maximum aperture, it's marked unreliable — the camera is almost certainly reporting the adapter default, not the actual setting. If the recorded value is something else entirely, it's marked unknown — unusual, but not necessarily wrong. Electronic lenses with confirmed aperture communication are marked reliable and skip estimation entirely.

This assessment layer prevents the system from running expensive AI analysis on photographs that don't need it. In the current portfolio, roughly 60% of images are shot on electronic lenses and exit the pipeline immediately.

AI Image Analysis

For photographs that require estimation, two parallel analysis calls are made using Claude Haiku's vision capability.

The Scene Analysis call examines the image for depth of field characteristics: how sharp is the foreground, how sharp is the background, how uniformly is sharpness distributed across the frame, what type of scene is being photographed (architecture, street, landscape, close-up), and how far the main subject appears to be from the camera.

The Depth Analysis call maps the depth layers in the image: what objects occupy the near plane, midground, and background, and whether the overall depth of field reads as shallow, moderate, deep, or very deep.

Both calls run concurrently. The combined output provides the raw signals that the scoring model needs to rank candidate apertures.

Ginkaku-ji temple garden in Kyoto photographed with the Zuiko 28mm, showing extensive depth throughout the frame

Scoring Model

The estimation algorithm ranks candidate apertures using four weighted signals:

Sharpness Match (40%) — Does the observed depth of field pattern match what this aperture would produce? A wide aperture (f/3.5) should show soft backgrounds and subject isolation. A small aperture (f/11–f/16) should show near-to-far sharpness. The algorithm compares the actual sharpness measurements against the expected pattern for each candidate.

Depth of Field Descriptor (30%) — The depth analysis returns a qualitative assessment: very shallow, shallow, moderate, deep, or very deep. Each descriptor maps to a probability distribution across aperture values. "Very deep" strongly favours f/11–f/16. "Shallow" favours f/3.5–f/5.6.

Scene Type Prior (15%) — Different scenes have different aperture conventions. Architecture and landscape shots tend to be stopped down. Close-ups and portraits tend to use wider apertures. These priors act as a Bayesian weight, tilting the estimate toward what is photographically likely for the scene type.

Subject Distance (15%) — Depth of field is a function of aperture, focal length, and subject distance. A far subject shows deep DoF even at wider apertures, while a close subject reveals aperture differences clearly. The distance signal adjusts how confidently the model can distinguish between candidates.

Each candidate receives a raw score from 0 to 1. If the top candidate scores below 50%, no estimate is published — the system acknowledges uncertainty rather than guessing.

Confidence and Transparency

Every estimate carries a reliability classification:

High (80–100%) — Strong agreement across all signals. The image characteristics clearly point to one aperture value.

Medium (60–79%) — Moderate agreement. The estimate is reasonable but multiple apertures could explain the observed characteristics.

Low (0–59%) — Weak agreement. The estimate is published if above 50%, but the viewer is informed that confidence is low.

This classification is displayed directly in the photography viewer. No estimate is presented as certain. The original recorded metadata is never overwritten — both values coexist, and the viewer understands exactly what they're looking at.

Kotohira shrine entrance in Kagawa, showing architectural depth estimated at f/8 by the aperture analysis system

Integration

Pipeline

The estimator plugs into the existing MokuPhoto generate-and-publish pipeline. During npm run generate, each photograph passes through EXIF extraction, lens classification, reliability assessment, and — if needed — AI estimation. The results are stored in the per-photo metadata JSON alongside titles, descriptions, and other AI-generated content.

For photographs already published, a dedicated --aperture-only flag runs estimation without re-processing vision titles or descriptions. This was used to retroactively enrich 96 existing photographs across six published series without touching any other metadata.

SeriesViewer Component

The SeriesViewer — the Framer React component that renders every photography series page — was updated to read the new aperture enrichment fields from the series JSON.

When a photograph was shot on an electronic lens, the Shooting Data tab displays aperture normally: a single value, no additional context needed.

When a photograph was shot on a vintage manual lens and an estimate is available, the display changes:

The estimated aperture is shown as the primary value with an [Estimated] badge. The reliability classification and confidence percentage appear inline. Below, a single line of context explains why: Vintage manual lens detected. Actual shooting aperture is not recorded electronically.

This treatment was designed to feel like a photography archive with AI-assisted metadata enrichment, not an AI demonstration. The estimate is the primary focus. The explanation provides context without overwhelming the data.

Technical Architecture

The feature is built as a standalone module at features/aperture-estimation/ within the MokuPhoto project, with its own package.json, TypeScript configuration, and test suite (36 unit tests across 4 test files).

The modular structure is designed for extensibility. Future metadata enrichment features — film simulation detection, lens characteristic profiling, image quality analysis — follow the same pattern: registry, assessment, AI analysis, confidence scoring, enrichment.

Module

Responsibility

lens-registry.ts

Lens profiles, classification (electronic vs vintage manual), candidate aperture sets

reliability.ts

Aperture reliability assessment — decides whether estimation is needed

image-analysis.ts

Scene sharpness and classification via Claude Haiku Vision

depth-analysis.ts

Depth layer mapping and DoF descriptor via Claude Haiku Vision

estimator.ts

Orchestrator — coordinates analysis, scoring, and candidate selection

confidence.ts

Confidence scoring, thresholds, and publishability gating

validation.ts

Benchmark framework — accuracy, precision, confusion matrix, failure analysis

Outcome

AI Aperture Estimation is live across the Mokujiro photography portfolio. Every series page that includes vintage lens photographs now displays enriched aperture data — estimated values with confidence scores and contextual explanation.

Across six published series, the system processed 96 photographs. Electronic lens images (Panasonic Leica 15mm, M.Zuiko 12-45mm PRO) were correctly identified as reliable and passed through without estimation. Vintage Zuiko 28mm images received AI-estimated apertures ranging from f/3.5 to f/16, with the majority falling in the f/8 to f/11 range — consistent with the architectural and street photography contexts in which the lens was used.

The validation framework is built and ready for accuracy tuning. The next step is a controlled test dataset: the same scenes photographed at each aperture stop with known ground truth, providing the data needed to calibrate the scoring model's weights and improve reliability scores from the current Low range toward Medium and High.

The feature demonstrates a broader principle for MokuPhoto: camera metadata is a starting point, not a finished record. When hardware limitations leave gaps in the data, software can fill them — transparently, with appropriate confidence, and without pretending to certainty it doesn't have.

AI Aperture Estimation

Field

Detail

Product

MokuPhoto AI Aperture Estimation

Type

Internal tool — metadata enrichment pipeline

Scope

Algorithm design, lens registry, computer vision analysis, Framer component integration, validation framework

Stack

TypeScript, Claude Haiku Vision API, Framer React, Cloudflare R2

Camera System

OM System OM-3 + Olympus OM Zuiko 28mm f/3.5 (vintage manual mount via adapter)

Studio

Mokujiro Studio

Location

Melbourne, Australia

Timeline

June 2026

Meiji Jingu shrine gate photographed with the Zuiko 28mm f/3.5 vintage manual lens

The Problem

Vintage manual-focus lenses are a deliberate choice. The Olympus OM Zuiko 28mm f/3.5, designed in the 1970s, renders light in a way that modern optics don't replicate. It's slow. It has no coatings to speak of. And when mounted on the OM-3 via an adapter, it produces images with a character that can't be designed digitally.

But it creates a metadata problem.

The OM-3 body communicates with modern electronic lenses through electrical contacts on the mount. When a Panasonic Leica 15mm f/1.7 is attached, the camera knows the aperture, focal length, and focus distance at every moment. The EXIF data is accurate.

When the Zuiko 28mm is mounted via adapter, those contacts are absent. The camera cannot read the aperture ring. It records the lens's maximum aperture — f/3.5 — regardless of what the photographer actually set. A shot taken at f/11 is tagged f/3.5. A shot taken at f/16 is tagged f/3.5. Every image carries the same incorrect value.

For a portfolio that displays full shooting metadata alongside every photograph, this isn't a minor inconvenience. It's false data presented as fact.

Night photograph of Tokyo architecture shot with the Zuiko 28mm, showing deep depth of field characteristic of a stopped-down aperture

Approach

Lens Classification

The first step was to stop treating all lenses equally. A configurable lens registry was built to classify every lens the system encounters. Each profile records whether the lens supports electronic aperture communication, whether it supports electronic focus, its maximum aperture, and the set of candidate aperture values it can produce.

When a photograph enters the pipeline, the system looks up the lens name from EXIF, matches it against the registry, and classifies it as electronic or vintage manual. Electronic lenses pass through immediately — their aperture data is reliable. Vintage manual lenses are flagged for estimation.

The registry currently covers the full lens kit used across the MokuPhoto portfolio: the Panasonic Leica 15mm f/1.7, the M.Zuiko 12-45mm f/4 PRO, and the two vintage Zuiko primes (28mm f/3.5 and 50mm f/1.8). Adding a new lens requires a single registry entry — no algorithm changes needed.

Reliability Assessment

Before running any AI analysis, the system evaluates whether the recorded aperture can be trusted. This is not a binary yes/no. A vintage lens reporting f/3.5 is evaluated differently depending on context:

If the recorded value matches the lens's maximum aperture, it's marked unreliable — the camera is almost certainly reporting the adapter default, not the actual setting. If the recorded value is something else entirely, it's marked unknown — unusual, but not necessarily wrong. Electronic lenses with confirmed aperture communication are marked reliable and skip estimation entirely.

This assessment layer prevents the system from running expensive AI analysis on photographs that don't need it. In the current portfolio, roughly 60% of images are shot on electronic lenses and exit the pipeline immediately.

AI Image Analysis

For photographs that require estimation, two parallel analysis calls are made using Claude Haiku's vision capability.

The Scene Analysis call examines the image for depth of field characteristics: how sharp is the foreground, how sharp is the background, how uniformly is sharpness distributed across the frame, what type of scene is being photographed (architecture, street, landscape, close-up), and how far the main subject appears to be from the camera.

The Depth Analysis call maps the depth layers in the image: what objects occupy the near plane, midground, and background, and whether the overall depth of field reads as shallow, moderate, deep, or very deep.

Both calls run concurrently. The combined output provides the raw signals that the scoring model needs to rank candidate apertures.

Ginkaku-ji temple garden in Kyoto photographed with the Zuiko 28mm, showing extensive depth throughout the frame

Scoring Model

The estimation algorithm ranks candidate apertures using four weighted signals:

Sharpness Match (40%) — Does the observed depth of field pattern match what this aperture would produce? A wide aperture (f/3.5) should show soft backgrounds and subject isolation. A small aperture (f/11–f/16) should show near-to-far sharpness. The algorithm compares the actual sharpness measurements against the expected pattern for each candidate.

Depth of Field Descriptor (30%) — The depth analysis returns a qualitative assessment: very shallow, shallow, moderate, deep, or very deep. Each descriptor maps to a probability distribution across aperture values. "Very deep" strongly favours f/11–f/16. "Shallow" favours f/3.5–f/5.6.

Scene Type Prior (15%) — Different scenes have different aperture conventions. Architecture and landscape shots tend to be stopped down. Close-ups and portraits tend to use wider apertures. These priors act as a Bayesian weight, tilting the estimate toward what is photographically likely for the scene type.

Subject Distance (15%) — Depth of field is a function of aperture, focal length, and subject distance. A far subject shows deep DoF even at wider apertures, while a close subject reveals aperture differences clearly. The distance signal adjusts how confidently the model can distinguish between candidates.

Each candidate receives a raw score from 0 to 1. If the top candidate scores below 50%, no estimate is published — the system acknowledges uncertainty rather than guessing.

Confidence and Transparency

Every estimate carries a reliability classification:

High (80–100%) — Strong agreement across all signals. The image characteristics clearly point to one aperture value.

Medium (60–79%) — Moderate agreement. The estimate is reasonable but multiple apertures could explain the observed characteristics.

Low (0–59%) — Weak agreement. The estimate is published if above 50%, but the viewer is informed that confidence is low.

This classification is displayed directly in the photography viewer. No estimate is presented as certain. The original recorded metadata is never overwritten — both values coexist, and the viewer understands exactly what they're looking at.

Kotohira shrine entrance in Kagawa, showing architectural depth estimated at f/8 by the aperture analysis system

Integration

Pipeline

The estimator plugs into the existing MokuPhoto generate-and-publish pipeline. During npm run generate, each photograph passes through EXIF extraction, lens classification, reliability assessment, and — if needed — AI estimation. The results are stored in the per-photo metadata JSON alongside titles, descriptions, and other AI-generated content.

For photographs already published, a dedicated --aperture-only flag runs estimation without re-processing vision titles or descriptions. This was used to retroactively enrich 96 existing photographs across six published series without touching any other metadata.

SeriesViewer Component

The SeriesViewer — the Framer React component that renders every photography series page — was updated to read the new aperture enrichment fields from the series JSON.

When a photograph was shot on an electronic lens, the Shooting Data tab displays aperture normally: a single value, no additional context needed.

When a photograph was shot on a vintage manual lens and an estimate is available, the display changes:

The estimated aperture is shown as the primary value with an [Estimated] badge. The reliability classification and confidence percentage appear inline. Below, a single line of context explains why: Vintage manual lens detected. Actual shooting aperture is not recorded electronically.

This treatment was designed to feel like a photography archive with AI-assisted metadata enrichment, not an AI demonstration. The estimate is the primary focus. The explanation provides context without overwhelming the data.

Technical Architecture

The feature is built as a standalone module at features/aperture-estimation/ within the MokuPhoto project, with its own package.json, TypeScript configuration, and test suite (36 unit tests across 4 test files).

The modular structure is designed for extensibility. Future metadata enrichment features — film simulation detection, lens characteristic profiling, image quality analysis — follow the same pattern: registry, assessment, AI analysis, confidence scoring, enrichment.

Module

Responsibility

lens-registry.ts

Lens profiles, classification (electronic vs vintage manual), candidate aperture sets

reliability.ts

Aperture reliability assessment — decides whether estimation is needed

image-analysis.ts

Scene sharpness and classification via Claude Haiku Vision

depth-analysis.ts

Depth layer mapping and DoF descriptor via Claude Haiku Vision

estimator.ts

Orchestrator — coordinates analysis, scoring, and candidate selection

confidence.ts

Confidence scoring, thresholds, and publishability gating

validation.ts

Benchmark framework — accuracy, precision, confusion matrix, failure analysis

Outcome

AI Aperture Estimation is live across the Mokujiro photography portfolio. Every series page that includes vintage lens photographs now displays enriched aperture data — estimated values with confidence scores and contextual explanation.

Across six published series, the system processed 96 photographs. Electronic lens images (Panasonic Leica 15mm, M.Zuiko 12-45mm PRO) were correctly identified as reliable and passed through without estimation. Vintage Zuiko 28mm images received AI-estimated apertures ranging from f/3.5 to f/16, with the majority falling in the f/8 to f/11 range — consistent with the architectural and street photography contexts in which the lens was used.

The validation framework is built and ready for accuracy tuning. The next step is a controlled test dataset: the same scenes photographed at each aperture stop with known ground truth, providing the data needed to calibrate the scoring model's weights and improve reliability scores from the current Low range toward Medium and High.

The feature demonstrates a broader principle for MokuPhoto: camera metadata is a starting point, not a finished record. When hardware limitations leave gaps in the data, software can fill them — transparently, with appropriate confidence, and without pretending to certainty it doesn't have.

© 2026 Mokujiro Studio

© 2026 Mokujiro Studio