The goal of this paper is twofold. Firstly, a Siamese-twin random projection neural network (ST-RPNN) is proposed for unsupervised binary hashing of images and compared with state-of-the-art techniques. Secondly, a comparison between Hamming-distance-based retrieval and a proposed bagging trees retrieval (BT-retrieval) algorithm operating directly on the PCA features is made with respect to performance, storage and search time. The ST-RPNN is made of two identical random projection neural networks and is trained to produce similar binary codes for similar input image pairs and different binary codes otherwise. The learning process is divided into two steps: a fast sparse neurons selection algorithm followed by an unsupervised bagging trees algorithm to extract the compact required-length code. Moreover, a BT-retrieval algorithm is proposed in this paper as a fast retrieval tool that ranks the database with respect to a query without distance calculations. Furthermore, (BT-PCA) is a novel extension where the BT-retrieval is applied directly on the PCA features with a significantly lower time search than Hamming-distance-based approach. The proposed technique is compared with ten unsupervised image binary hashing techniques on the COREL1K dataset and the CIFAR10 dataset. The proposed technique obtained better precision–recall results than all compared techniques on the COREL1K dataset, and better than eight of them on the CIFAR10 dataset.