Even with a base resistor (or especially with one), you still have a problem with that circuit, because right after the bridge rectifier you're still going to have 100-120 pulses of DC :
So the transistor may turn off for very brief periods and your pic will incorrectly think you don't have AC adapter plugged in. So move the capacitor right after the bridge rectifier because the 7812 doesn't need it anyway if it's powered from battery (but it doesn't hurt).
You could just use a 5.6v zener (or less) and set interrupt on pin change.. when adapter fails, pin goes to 0v from 5.6v and you can configure the PIC to detect that.
ps. And what's the deal with C16 and C17? 100nF = 0.1uF ... makes no sense to use 2 of those of same size.
ps2. I'm also bothered by how you connect the battery. The label says 12v Pb .. I assume that's a car battery? That will be 10.8-13.5v or something like that.
The 7812 being a linear regulator it will need 1.5-2V *above* the output voltage to output a proper 12v. It's 2v for around 1A, less at lower currents. I'm ignoring the schottky diode voltage drop as that's only about 0.1-0.3v.
So as you connected it, the battery would have to be about 13.5-14v all the time to see on the output of that regulator 12v - as the battery discharges, you will see 10-11v on the output of that regulator.
Use a regulator with less voltage drop, for example 1117 which needs only 1v above output voltage... but be careful as some 1117 (depends on manufacturer) only tolerate up to 15-16v on the input.