When a factory introduces AI visual inspection, the model cannot recover a defect that the camera never captured clearly. Lighting turns a physical difference into a visible signal. This guide connects lighting selection with deployment: defining defects, comparing dome and coaxial lighting on reflective parts, running sample trials, and agreeing on factory and site acceptance tests. The same process applies when retrofitting a production line in Thailand: start with the part and the defect, test the optics, then check whether the image can be reproduced on site.
Why lighting comes before AI model tuning
A camera records light emitted by a source, reflected, transmitted or scattered by the part, and passed through a lens. If a defect and an acceptable feature have almost the same appearance in that image, adding training data cannot reliably create information that is absent. Good lighting suppresses irrelevant variation and emphasizes the feature to be inspected. AI still has an important role, but it should receive an image produced under deliberate, repeatable conditions.
KEYENCE’s lighting selection guide proposes assessing how light interacts with the part, then selecting the light’s form and size, and finally its wavelength. Basler’s technical guide explains why both underexposure and overexposure remove useful information. Neither principle reduces to “make the scene brighter.”
If lighting is treated as a final accessory, teams may try to compensate for weak image contrast by changing thresholds or retraining a model. Highlights can then move when a part tilts slightly; ambient light can vary; and surface finish can change between lots. Those are changes in the observation conditions. Establish how to reveal the defect optically, then preserve that setup through mechanical mounting, triggering, recipes, and maintenance.
Define the reject condition before opening a lighting catalogue
Record the inspection area, smallest relevant defect, depth or color difference, acceptable natural variation, and areas excluded from judgement. A scratch on polished metal, a scuff on molded plastic and a crease in clear film do not reflect light in the same way. Collect samples at the acceptable and reject limits, and have quality staff confirm their labels. Include acceptable parts with patterns that could be confused with a defect.
One image does not need to serve every inspection item. A shallow surface mark and a missing edge may require different lighting. Multiple capture conditions can make quality criteria easier to explain, but they also affect cycle time, triggering, wiring and storage. Decide with the line constraints in view.
How to choose machine vision lighting by light path
The main techniques are front or bright field lighting, shallow angle or dark field lighting, diffuse lighting from multiple directions, and transmitted backlighting. A fixture’s shape alone does not determine the technique: a bar light can create a bright field or highlight scratches depending on its position. Basler describes how dark field light makes scratches and edges appear bright, while backlighting shows an outline but loses surface texture.
| Information needed | First techniques to test | Expected image | Main caution |
|---|---|---|---|
| Fine scratches on a flat metal surface | Low angle dark field; bar lights from different directions | Scratch scatters light into the camera | Scratch direction changes visibility |
| Markings or contamination on a near mirror flat | Coaxial or diffuse coaxial lighting | More even plane; local differences stand out | Tilt and steps alter the return light |
| Curved or uneven reflective part | Dome lighting | Broad diffuse light reduces hot spots | It can also hide shallow relief |
| Hole, outline or dimensional edge | Backlight | Stable silhouette | A separate image may be needed for surface defects |
| Printing or color difference | Test wavelength and camera combination | Contrast between target and background changes | A true color requirement may need color imaging |
This is a trial order, not a product prescription. Material, coating, curvature, background and working distance interact. Capture the same parts under multiple setups and compare whether the relevant defects remain distinct from acceptable variation.

Bright field and dark field reveal different information
Bright field uses light returned from a smooth surface toward the camera. In dark field, the normal surface’s direct reflection is kept away from the camera while light scattered by a scratch or edge is collected. A scratch may become a bright line, but acceptable texture may brighten too. Compare both defect and good patterns before committing.
A single bar light may miss scratches oriented in a particular direction. Test a second direction or opposite side; if necessary, capture sequential images with separately switched lights. Turning every light on together can mix the contrast and conceal the defect again. Record what each direction contributes before adding hardware.
Dome versus coaxial lighting for reflective parts
Coaxial lighting directs light along the camera’s optical axis, often through a beam splitter. It is a candidate for flat, reflective surfaces; tilt, steps and curvature change the return light. A dome sends diffuse light from a wide range of angles, which can suppress localized glare on shiny curved or uneven objects. KEYENCE and A3 describe the distinct roles of these geometries.
“Reflective means dome” is too simple: diffuse light may flatten the contrast of a shallow scratch. “Flat means coaxial” can also fail when a moving part tilts. Compare not only the best defect image, but background stability across good parts, positions and angles. A swap fixture and records of the same lot under each light make the comparison auditable.
Polarizers are another option for controlling reflections. They also reduce available light and may weaken the defect signal. Keep the inspection objective and camera settings documented while comparing images before and after adding polarization. Do not assume one polarizer arrangement will reveal every internal flaw in clear material; test the actual workpiece.

Select wavelength, camera and lens as one optical system
Lighting color changes how a material and its defects reflect or absorb light. Even with a monochrome camera, a red or blue source can change the gray value relationship between colored features. If true color is the inspection criterion, include a color camera and appropriate white lighting in the trial. If the task is presence of a particular mark, monochrome imaging with a selected wavelength may be enough. Basler’s guide illustrates how wavelength changes contrast.
But changing wavelength alone is not a fair comparison unless camera sensitivity, lens transmission, filters, light output and exposure are considered. Save each raw image with light type, wavelength, position, angle, exposure, gain, aperture and focus. A note saying only “red was better” will not reproduce the setup.
Pixel scale is an entry check, not a detection guarantee
Field of view divided by pixel count gives a first estimate of object scale per pixel. Illustrative calculation only: if an 80 mm field spans 2,048 pixels, 80 ÷ 2,048 ≈ 0.039 mm per pixel. A 0.20 mm mark occupies roughly five pixels geometrically. This does not state a detection rate. Lens resolution, focus, motion blur, contrast, pixel arrangement, compression and the decision method all matter.
If the defect is not adequately represented in the image, increasing light intensity later cannot restore the missing spatial detail. Capture real boundary samples across the field of view. When comparing camera specifications, check that sensitivity and noise figures were measured consistently. EMVA 1288 provides a framework for comparable machine vision camera characterization; it does not prescribe a particular lighting placement.
Exposure, strobe and line speed belong in the same calculation
Movement during exposure produces image blur. Illustrative calculation only: at 300 mm/s and 100 µs exposure, movement is 300 × 0.0001 = 0.03 mm, or about 0.77 pixel at the illustrative scale above. Actual feasibility also depends on trigger delay, vibration, light response and sensor exposure behavior.
For strobed lighting, check camera and controller synchronization, rated duty cycle, heat, cable runs and recipe restoration after maintenance. OMRON’s technical paper discusses strobes and blur on moving parts. Use the selected manufacturer’s ratings rather than copying illustrative values into a machine setting.
Design a sample trial that seeks failure conditions
An early trial should identify when a defect disappears, not merely produce one attractive image. Trials on only easy rejects and perfect good parts overlook borderline defects and new lots. Quality, production, maintenance and equipment staff should share the same sample register.
- Collect acceptable limits, reject limits and difficult acceptable patterns for each item; have quality confirm labels.
- Record coating, color, lot, molding condition, soil and position variation that can actually occur.
- Change one lighting condition at a time and retain raw images, not only enhanced results.
- Evaluate the defect against its background at the center, corners, edges and glare prone positions.
- After narrowing optical candidates, separate model training and evaluation data across lots and dates.
- Plan repeat tests for dirt, light position shifts and other maintenance conditions; agree on acceptance criteria.
Compare target contrast, acceptable patterns, saturated areas, shadows, focus and positional variation, not just average brightness. If an eight bit display image is used for discussion, retain higher bit depth raw data when relevant. Document the fixture and part placement so the setup can be recreated.
Give AI a defined range of variation
AI can handle normal part variation when that variation is represented in training and evaluation. It cannot recover details erased by saturation or full shadow. Before retraining for a new failure, check light position, output, exposure, shielding and lens cleanliness. Conversely, a trial that eliminates all realistic process variation can overstate performance. Define the allowed imaging variation and decide which changes call for equipment adjustment versus additional data and model review.
FAT and SAT: accept the image conditions as well as the result
Here FAT means factory acceptance testing before shipment and SAT means site acceptance testing after installation, as defined for the project. No universal pass value is implied. Agree on values based on defect severity, line risk and available boundary samples. “High AI accuracy” alone does not demonstrate image repeatability.
| Stage | Conditions to verify | Evidence to retain | Decision example |
|---|---|---|---|
| Preliminary trial | Defect definition, optical candidates, representative samples | Raw images, condition sheet, sample register | Agree on candidates to advance |
| FAT | Light position, exposure, trigger, imaging and judgement across samples | Settings backup, images, logs, fixture drawing | Agreed test items pass |
| SAT | Actual mount, transport, ambient light, vibration, power, maintenance access | Site images, repeat test, change log | Site procedure passes as agreed |
| Operation | Cleaning, replacement, periodic image check | Reference images, inspection and change records | Recovery procedure works after drift |
At FAT, document camera and machine geometry, light angle and distance, and shielding with drawings and photos. Verify failure behavior when a light is off, a trigger is missed, or an image saturates. Check latency to the decision, PLC output and product recipe changes. At SAT, test the difference between laboratory and line conditions. Overhead lights, windows, shiny guarding, adjacent machines and transport vibration can matter. Teledyne DALSA’s introduction advises controlled lighting rather than reliance on changing ambient light. Inspect each actual factory; broad assumptions about Thailand’s climate do not replace site measurement.

Write acceptance criteria in two layers
State both the quality result and the image conditions under which it is obtained. For example, specify that agreed boundary samples will be imaged at the required cycle time and judged using the agreed decision table. Put sample identities, repetitions, metrics and exception handling in the test protocol. Set numerical limits from real samples and risk review rather than an online example.
The condition sheet should include light model and position, output and wavelength, strobe setting, camera, lens and aperture, exposure and gain, shielding and fixture position. When any of these changes, compare raw images and rerun the relevant sample set before relying on retraining alone. Record backup location, restoration owner and approval authority.
Check total scope before requesting a quotation
The cost of lighting selection is broader than fixture price. Sample preparation, adjustable brackets, shielding, controller, trigger wiring, safety, storage, PLC integration, FAT, SAT, spare parts and operator handover all matter. Planned line downtime affects schedule and cost. Ordering a camera and light while leaving installation work undefined can fragment responsibility.
For a request for quotation, provide part drawings, surface material, inspection faces, defect photos, minimum target, line speed, number of product variants, mounting space, and existing PLC/network specifications. If images or samples cannot leave the site, agree on a practical trial procedure early. Ask suppliers to explain why the proposed light won over alternatives and which defects the rejected arrangements failed to reveal.
Make replacement and restoration part of the specification: physical locating features, saved settings, a reference workpiece and periodic reference images. Check the chosen product’s electrical and thermal ratings, replacement options and availability plan. These decisions affect operational recovery, not merely purchase price.
Troubleshoot changed lighting conditions on the production line
If false decisions increase after production starts, compare the raw images with reference images first. A uniformly darker image, a dark area on only one side, and reflection changes affecting only one product variant lead to different checks. For an image wide change, inspect light power and exposure settings. For a local change, inspect light or camera position and lens contamination. For a variant specific change, inspect the workpiece surface and changeover conditions. The model’s score alone cannot show whether the cause is optical.
After an operator cleans or replaces a component, image the reference workpiece and confirm position, brightness and defect appearance before resuming inspection. The work instruction should state what cleaning materials to use, how to handle the lens and light cover, and who may realign the station. Temporarily increasing light output can hide one problem while saturating another part of the image. Define when to stop the line, re-inspect product and notify quality if the reference condition is missed.
Link images and decisions to product variant, timestamp, setting version, lighting state and workpiece identifier. With traceable records, the team can assess which range of production needs re-inspection rather than automatically rechecking every lot. Set retention and access rules according to customer and internal quality requirements. These controls are separate from algorithm performance, but necessary when AI inspection forms part of quality assurance.
Give suppliers the same conditions when comparing proposals
Provide each supplier with the same boundary samples, inspection faces and transport conditions. If each uses different samples or metrics, a comparison of lighting proposals becomes a comparison of test conditions. Where confidentiality prevents samples leaving the site, provide equal on-site capture time and evaluation steps. Ask for raw images, light placement drawings, failure cases and maintenance proposals in a common format. This supports assessment of responsibility after installation as well as technical performance.
Include acceptable product variation in the delivery specification, not only a list of defects. Detecting many rejects is not sufficient if the arrangement stops large numbers of acceptable parts. Agree on manual judgement when inspection is unavailable, comparisons before and after model updates, and the extent of retesting when a new product variant is added. Those agreements make post-installation change control clearer.
Minimum information to retain in the trial report
A trial report should be more than a gallery marked “visible” or “invisible.” It should enable someone else to create the same conditions. In one condition sheet, record workpiece model and lot, surface finish, inspection face, defect location, light and controller models, mounting position, camera and lens, wavelength, exposure, gain, aperture and distance from workpiece to lens. Keep capture time and ambient light condition too. The reason for rejecting a lighting method matters as much as the explanation of the selected one. For example, “coaxial lighting was stable in the flat center, but edge warpage changed background brightness” gives future teams usable evidence.
Attach not only an acceptable or reject label to each image, but also the quality department’s reason for that judgement. Some rejects are obvious; others lie near the boundary. If a trial reveals only obvious rejects, it is premature to approve the setup for production. If no boundary samples have been defined, resolve the quality criterion before continuing to change lights. That separates an imaging problem from a decision-criterion problem.
When splitting images into model training and evaluation sets, avoid placing a burst of nearly identical captures of the same workpiece in both. Repeated backgrounds and scratches make it difficult to assess performance on an unseen part. Reserve other lots, dates and, where possible, process conditions for evaluation. Use the same separation principle for monitoring after launch. Record one change at a time when comparing lighting improvements with model changes; otherwise the cause of a result is unclear.
In a meeting to set production criteria, focus on the hardest sample images. Clearly seeing easy rejects is necessary but does not qualify the station to run independently. At areas where acceptable and reject limits are close, ask whether changing light direction increases their separation or changes both images in the same way. Keep disputed samples in a quality-criteria review queue rather than forcing a label. This prevents ambiguity in the image from being mistaken for ambiguity in the AI model.
If inspection covers several product variants, do not freeze the lighting layout based only on one representative variant. Height, color, roughness and transport orientation can change the background under the same source. If a variant recipe changes light output or exposure, test that the changeover signal and the settings actually loaded agree in both FAT and SAT. If an operator selects the variant manually, verify how a wrong selection is detected and how its decisions can be traced. Usability and protection against mistakes are part of deployment judgement alongside model metrics.
Do not fill gaps in limited sample availability with assumptions. If boundary parts cannot be obtained, state the defect range tested and the range still unverified. Substitute samples or artificial scratches may differ in geometry or reflection from production defects. Artificial marks can help compare optical setups, but cannot by themselves guarantee detection on production parts. Include a later evaluation with real rejects in the quotation or acceptance plan.
After launch, do more than collect false-reject and missed-defect images. Record whether each case arose from lighting conditions or from the defect definition. Match image logs to dates when a light angle was changed, a protective window replaced, or a surface treatment changed. If equipment conditions caused the issue, restore normal imaging before adding all affected images to training. If the decision criterion caused it, revise labels and evaluation data with quality approval. This change history lets the team compare trial and production performance on the same basis.
When are multiple lights or cameras justified?
Add another view when one setup cannot stably show all agreed inspection items. For example, use a backlight for outline, dark field for scratches and diffuse light for printing. Each added capture must contribute a stated quality decision; otherwise it adds adjustment and failure points. Sequentially switched lights may work with one camera, but the control differs between a stopped part and a moving one. Verify takt, trigger accuracy and image identity in the trial.
Frequently asked questions
Which lighting color should visual inspection use?
Select it from the part’s reflection and absorption and the information to be judged. Evaluate white light and a color camera for true color criteria. A monochrome camera with selected wavelength can work for shape or a specific mark. Compare actual samples under documented conditions.
Is dome or coaxial lighting better for reflective parts?
Coaxial is a candidate for a near mirror flat; dome is a candidate for curved or uneven reflective parts. Diffuse light may reduce the contrast of shallow scratches. Compare across part tilt and acceptable surface variation, including dark field where useful.
Can AI compensate for lighting variation?
It can learn a defined range represented in data. It cannot recover a feature lost to saturation or shadow. Control position, shielding, exposure and cleaning first, then test across unseen lots and dates.
What should FAT and SAT verify for lighting?
FAT checks settings and sample imaging on the machine; SAT repeats the assessment with the installed mount, line motion, ambient light and maintenance conditions. Agree on criteria in advance and retain settings, raw images and judgement logs.
Can we test an AI model before selecting the light?
An exploratory test is possible. Record how its images were captured and do not finalize the light based only on model scores. First narrow the optics to setups where relevant defects are visible and acceptable product variation does not destabilize the image; then compare models.
Conclusion: can the factory sustain the image that reveals the defect?
AI visual inspection lighting selection connects defect definition, light direction and wavelength, camera and exposure, sample trials, FAT and SAT. Coaxial, dome, dark field and backlight each have a useful role, but real parts and realistic site variation decide. A reproducible setup, with clear restoration instructions, is what turns a successful trial into an operable inspection station.
If you are assessing reflective parts or a retrofit to an existing line, share photos of the part and the defects you need to find with TOMAS TECH. You can consult us while comparing lighting concepts or defining FAT and SAT conditions.