The growth of high quality GaN films offers the possibility of making this wide band gap material available for the fabrication of novel microelectronic devices with unique properties. However, growth defects that arise from the growth process result in high leakage currents that may be detrimental for some practical applications. It has been shown that these leakage currents can be compensated by the deliberate introduction of new defects by ion beam irradiation. The phenomenon has been investigated by use of a focused ion beam in a nuclear microprobe. AlGaN/GaN films were deposited on sapphire and then an interdigitated electrode pattern was deposited on the surface. Irradiation of the film through the electrodes allowed the resistivity to be monitored on-line. Irradiated areas displayed greatly improved signal to noise ratio when employed as a UV detector.