Just came to share a link i came across about learning perfect pitch and fundamentals of practicing piano. May be this has already been discussed here? Seems musical to integrate this kind of learning into piano practice. Also there was a chapter about Bach's inventions in this book. The page:
http://www.pianofundamentals.com/book/en/1.III.12

There are newer editions of the book. In second edition the author says if not practiced he loses this ability. Basically it is explained as a memorizing and testing technique, not a perceiving chroma technique. However playing music in the head helps a lot.