A Cognitive Approach for Community Detection