Algorithms for object categorization have demonstrated great achievements in learning, processing and comparing objects. The problem occurs if the database of solved objects is too large and the classification time is being increased proportionally. We present a solution by optimalization of obtained knowledge from learning, using the clustering of a modified neural network. Several methods for modifying a number of clusters to increase the speed or the accuracy of classification are shown. Additionally, the proposed algorithm is able to compute the similarity between clusters of various classes and then create statements about the homogeneity, independence, inferiority and similarity of classes. A series of experiments is shown, some of them also as a part of the multi-agent system, Nao robots and gestures and emotions. The analysis could be useful for students and researchers of the computational intelligence or anyone else who may be considering utlizing neural networks for the object categorization and analysis of obtained knowledge from images or from a video stream.