I am unsure of books, physical resources etc. However, learning scales fluently is a must when improvising and composing (which are, in essence, the same thing).
Something that helped me, practicing songs/pieces over and over, not just so you can play it, but so you are comfortable with the feel of the music. You should be able to add notes in, take notes out, add or adjust little ideas within the pieces and have it still sounding good. Once you learn to improvise/compose around other pieces, improvisation and composition from scratch is so much easier.
As to your mention of the science behind composition, music is not a science as such. You should learn keys and what chords go with each key: this really helps with improvisation because so long as chords are within a certain key, it will sound good.
However, with composition, you should also break some of these rules, not all the time, but occasionally. As said by Hans Zimmer:
"If there's a rule, break it, that's the only way to move things forward."
For example, where you 'should' (theoretically) resolve to a minor chord, switch it to major, push the boundaries and see where it takes you, this way you will discover your own style, as well as discovering what sounds good.
For learning keys, the quickest and most efficient way is 'brute force'. Do not use acronyms as in the long run they slow you down. Simply learn the lists. This is what my theory teacher taught me and it has stuck with me since.
Learn the order of flat and sharp keys so that you can say them in the order out loud without thinking, make it instinctual. Flats: (C), F, Bb, Eb, Ab, Db, Gb, Cb, Fb. Sharps: (C), G, D, A, E, B, F#, C#. Then if need to know how many flats are in the key of Eb, you just count on your fingers: C (0 flats), F is 1, Bb is 2, Eb is 3 - 3 flats in Eb major.
You can similarly learn the order of sharps and flats this way. Flats: B E A D G C F. Sharps: F C G D A E B.
You should learn that to convert a major scale to a minor scale you simply add 3 flats to the signature (or remove 3 sharps).
To work out which diatonic chords go into a key, practice the scales by selecting a random note and playing the major and minor scales of it. Then build triads off of each degree of the scale, playing around with inversions.
By practicing this regularly you can VERY quickly get used to keys, chords, scales and therefore composing/improv.