Astronomy has always been at the cutting edge of data volumes but the growth of interest in short timescale variability is taking that to an entirely new level. The new generation of multi-epoch, multi-band and wide field-of-view astronomical surveys will generate a deluge of astronomical sources, including variables and transients. The sheer volume of this data suggests that transient detection and localization are transitioning from an offline process, to an online and real-time, automated decision-making procedure. In response, this thesis presents an interdisciplinary study of the transient and variable classification problem, with the aim of developing several machine learning (ML) based methods for both optical and radio astronomy. This thesis starts with the classification of 11 types of periodic variable stars acquired with the Catalina Real-Time Transient Survey (CRTS). Based on our analyses, we find that accurate variable star classification is possible with just seven features - much fewer than in other works. In addition, we show that this classification problem cannot be solved with a 'flat' multiclass classification approach, as the data are inherently imbalanced. To partially alleviate the 'imbalanced learning problem', we convert a standard multiclass problem into a hierarchical classification problem, by aggregating subclasses in to superclasses. This results in improved performance on rare class examples typically misclassified by multiclass methods. To further improve the hierarchical classification performance, we apply 'data-level' approaches to directly augment the training data so that they better describe under-represented classes. When combining the 'algorithm-level' together with the 'data-level' approach, we further improve variable star classification accuracy by 1-4%. In addition, in order to have an early and rapid characterisation of interesting candidates in optical and radio surveys, it is fundamentally important to automate several steps within a transient detection pipeline, including the separation of transients/astrophysical events from 'bogus' or Radio Frequency Interference (RFI) detections, which has become a bottle-neck in fast detection pipelines. To address this challenging task, we built MeerCRAB and FRBID - ML software based on a Convolutional Neural Network. MeerCRAB has been deployed in the MeerLICHT transient vetting pipeline and is designed to filter out the so called 'bogus' detections from true astrophysical sources. Optical candidates from the MeerLICHT telescope are described using a variety of 2D images. However, the relationship between the input images and the target classes is unclear, since the ground truth is poorly defined and often the subject of debate. This makes it a challenging task to find which numerical features or source of information should be utilised to build a classifier. We therefore used two methods for labelling our data (i) thresholding and (ii) latent class model approaches. Afterwards, variants of MeerCRAB models are deployed using different combinations of input images and training set choices, based on classification labels provided by volunteers. We found that the deepest network worked best with an accuracy of 99.5%. FRBID is being used in MeerTRAP - a backend for the MeerKAT radio telescope that continuously searches for radio transients and pulsars. FRBID aims to remove any remaining RFI and classify new astrophysical candidates automatically in real-time. The performance of FRBID shows less than 1% false positive rate. Up till date, FRBID has detected more than half a dozen new FRB candidates, even in the presence of RFI. This discovery shows how accurate and efficient an ML algorithm can be, in real-time processes. Lastly, this thesis provides a first proof of concept of a model, Fast Radio Burst Localization & dEtection, FABLE, based on Mask R-CNN. FABLE is used for automatic detection, segmentation, and classification of FRBs with Dispersion Measure-Time (DM-T) images. We focus on improving the detection rate of FRBs, especially for low signal to noise ratio (SNR) in radio images and to identify 'single pulse' from background noise. The FABLE algorithm provides us with the probability that the detected source, is an FRB/Single Pulse and also the position of the FRB. In addition, FABLE outputs the DM and time parameters of the detected candidate, which allow us to characterise the FRB candidate detected. The time parameter is used to extract a piece of the original filterbank data and to de-disperse it to generate two further plots which astronomers will want to look at: a de-dispersed pulse, and the frequency - time plot. Moreover, FABLE's performance is evaluated on the Average-Precision (AP) score metric. We measure a precision of 99.9% at 90% recall for FRB/SP with a minimum detection confidence threshold of 0.5. The FABLE model can serve as a new tool for real-time pipeline that can automatically detect FRB/SP and can be adopted in other domains in astronomy, for e.g. in source extraction software for detecting and localizing sources in astronomical images.