When you say you can hear the starter do you mean you can hear it spinning or just clicking? If the starter is spinning but it is not turning the engine over it could be the bendix is sticking or the sprag clutch is worn.....if so it'll be a case of removing the starter and cleaning the bendix if it has one or checking the sprag clutch.... If the starter is just clicking it could be the connection to the starter, earth connection somewhere or possibly a dead winding on the starter itself. Have you tried jumping it from another battery/car when it doesn't start? That'll prove if it's the battery or not. If between attempts to start the bike you haven't charged the battery and sometimes it'll start and other times not that would point to loose connection somewhere, dead winding on starter, sticking bendix, worn sprag clutch, etc rather than a dodgy battery... Good Luck