Context: It is crucial to develop a method for classifying objects detected in deep surveys at infrared wavelengths. We specifically need a method to separate galaxies from stars using only the infrared information to study the properties of galaxies, e.g., to estimate the angular correlation function, without introducing any additional bias. Aims. We aim to separate stars and galaxies in the data from the AKARI North Ecliptic Pole (NEP) Deep survey collected in nine AKARI / IRC bands from 2 to 24 {\mu}m that cover the near- and mid-infrared wavelengths (hereafter NIR and MIR). We plan to estimate the correlation function for NIR and MIR galaxies from a sample selected according to our criteria in future research. Methods: We used support vector machines (SVM) to study the distribution of stars and galaxies in the AKARIs multicolor space. We defined the training samples of these objects by calculating their infrared stellarity parameter (sgc). We created the most efficient classifier and then tested it on the whole sample. We confirmed the developed separation with auxiliary optical data obtained by the Subaru telescope and by creating Euclidean normalized number count plots. Results: We obtain a 90% accuracy in pinpointing galaxies and 98% accuracy for stars in infrared multicolor space with the infrared SVM classifier. The source counts and comparison with the optical data (with a consistency of 65% for selecting stars and 96% for galaxies) confirm that our star/galaxy separation methods are reliable. Conclusions: The infrared classifier derived with the SVM method based on infrared sgc- selected training samples proves to be very efficient and accurate in selecting stars and galaxies in deep surveys at infrared wavelengths carried out without any previous target object selection.