Embodiments of the disclosure provide a system and method for detection of a transient air bubble in an arterial blood flow path during dialysis (e.g., hemodialysis). The system uses measurements from an optical sensor to remove one or more effects of common factors affecting the absorbance of the light incident on the arterial tubing. These factors include color of medium within the arterial tubing, tubing color, angle of illumination, and temperature of the optical detector. A variance of the measurements from the optical sensor are used to determine whether an air bubble is present.