1 Introduction

Data mining is the process of sorting through large data sets to identify patterns and establish relationships to solve problems through data analysis. The important task of data mining which performs automatic analysis of wide amount of data to extract important patterns such as group of data records are called as clustering whereas group of unusual records are called anomaly detection and dependencies is called as association rule mining.

Clustering is a data mining algorithm which combines a set of related objects into one cluster and set of unrelated objects into another cluster. The popularity of cluster include grouping with slight distances between cluster members therefore clustering can be calculated with multiple goal optimization problem. Selection of proper clustering algorithm and parameters such as distance to be used, threshold with density or count of cluster depends on type of data set chosen and planned use of results [1].

Clustering is an iterative process of discovery of knowledge. Also it is not an automatic task, as clustering involves multiple goal optimization technique which involves multiple trial and failure. The concept of cluster cannot be precisely defined as many clustering models are available. Few of models like hierarchical clustering is based on connectivity of distance. The centroid model which is based on single mean vector is k means algorithm. Clusters are modeled using statistical distribution model which is expectation maximization algorithm. Clusters that are formed in density space region is density model [2].

Clustering have numerous applications, one of the application crime is highlighted in this paper. An act which is harmful not only to individual citizen but also to Community or to State or to Country is crime. Such acts are forbidden or punishable by law. Most important factor in analysis of crime, is to use the past data containing details about crime. Crime prediction is a process that finds out crime rate change from 1 year to the next. Crime prediction will be helpful to visualize the criminal network, also it helps the community to know the places where more crimes have taken place. The challenge here is that these crime prediction techniques take lot of computational time for predicting crimes [3].

Nature based system [4] is currently being highlighted by many researchers. It has been inspired by nature’s social behavior which is reflected in fishes or birds or ants or bats. Many important characteristics can be taken from them and can be developed into best optimized algorithm which can solve plenty of problems very effectively and efficiently. A very special class based on intelligence of swarm is highlighted in this proposed work.

2 Literature survey

Boratyn et al. [5] has proposed a biologically supervised approach which produces better clustering results than unsupervised method which has been justified from model temporal profiles.

The author Zhang et al. [6] has proposed a novel combined approach by integrating basic PSO and learning automata in environment where noise is present. Learning Automata has good features like self-automation, automatically learning capability and very low computation complexity. These features converge in all situations, and when combined with Basic PSO results into more accurate and faster algorithm and also finds best particle efficiently.

The author Sun and Li [7] has proposed two cooperative based particle swarm optimization technique. In which the author has described two swarm particles population, one is master swarm which takes care of particle velocity updation and keeps the diversity of algorithm invariant and other slave swarm particle concentrates on local optimum problem of algorithm which converges faster by making updation in dimension of each particle from same neighboring dimensions of particle.

Tao et al. [8] has highlighted a technique which is based on the new ant colony algorithm with high dimensional data and unknown number of clusters which improves existing clusters.

The author Dipali and Anuradha [9] has proposed a combined algorithm using colony-based ant and swarm-based particle optimization. The new algorithm initially finds good centroids with ant-based colony technique and then later optimize it with different fitness function of particle swarm-based optimization. The results were tested on IRIS dataset with different evaluation metrics.

The author Agarwal et al. [10] has proposed a new algorithm for analyzing crime homicide using rapid miner tool. The crime homicide was analyzed into clusters and later plotted with respect to the year. Also the rate of decreasing number of homicide cases in the country is also discussed. The author has concluded that same algorithm can be used for analyzing other crimes.

Jani [11] presents detailed study on clustering techniques and its role on crime identification with genetic algorithms to solve complex computational problem. The proposed algorithm will help to identify effective criminal and crime patterns. And it will also help to predict crime. In proposed algorithm genetic parameters were used and the experiment has been conducted to find a better output.

Sharma [12] has proposed a new technique for detecting cautious mails which relates to crime. This problem was analyzed using data mining technique decision tree with new feature selection method. The main objective was to detect suspicious criminal activities and minimize them to call as ‘ZCRIME’ which means zero crime.

The author Chuang et al. [13] has discussed a technique of clustering which considers random sequence as random starting point as a parameter which has adopted gauss chaotic map. These parameters were used to update velocity and position of parameter. This method balance exploration and exploitation capability of seed process. Also, it generated random seed which improves the performance of PSO.

The author Davoud and Ellips [14] has discussed various development methods and approaches of PSO along with parameters needed. The author discusses PSO as very suitable tool in various optimization problems by considering its efficiency.

The author Sadrina et al. [15] has discussed various natural based problems like green supply chain and green logistics which can be solved using multiple objective algorithm instead of single objective. Such algorithm is very highly optimized and results into better output.

Neveen et al. [16] has proposed a new approach for improving Data clustering. The author has also compared basic PSO algorithm with exponential PSO. The basic algorithm works on linear inertia weight whereas exponential particle swarm optimization uses exponential variation for inertia weight.

The author Prabha and Visalakshi [17] has proposed improved k means PSO Clustering which works on the concept of normalization with effective partitional clustering algorithm.

The author Behdad et al. [18] has discussed about the popular types of fraud happening electronically and few techniques of detection. The author has discussed new emerging types of fraud that can be solved using nature inspired techniques which are robust with any possible environment changes and this nature inspired techniques are versatile.

The author Saravana et al. [19] has proposed a system which has identified criminal which are probable involved in crime related activities. A new technique called as Soft system methodology (SSM) has been developed by making use of stored cases histories of crime and generated into new prediction techniques.

Vineeth et al. [20] has described a new correlation analysis technique which finds frequent sets of crime. A concept of intensity points related to crime is generated which gives each crime type some weightage numbers. These are correlated with crime intensity point and result into predication of which states have more no of crimes.

The author Hamdy et al. [21] has proposed a system which has helped crime analyst for crime detection using good decisions. The system has checked ideas behind crimes, polices of crime and result into prevention of crimes. Using these system a expected problematic properties of crime can also be detected.

Each researcher has tried excellent work on their parts with the use of optimization algorithm in which various problems were solved. Also using basic k-means various crime related issues have been solved.

3 Basic PSO

A computational method that optimizes the problem by repetitively trying to improve the candidate solution with regard to a given measure of quality, such method is called as Particle swarm optimization. Particle means candidate solution, swarm is a group of particles and optimizations means selection of best particle. According to simple mathematical formulae, PSO solves a problem by having a population of particles and moving these particles around in the search space with particle’s position and velocity. The Swarm moves towards the best solutions which is influenced by local best-known position. Along with the position of each particle the velocity describes the movement of particles with respect to distance and direction. The particles which are moving are learning from each other and obeying some simple rules in their neighborhood to find the best solution for an optimization problem by defining the mathematical model of motion of particles.

The mathematical model of PSO is very simple and it can be defined with time index or steps as shown below.

  1. (a)

    On every iteration of PSO, position and velocity of every particle is updated accordingly.

  2. (b)

    A new velocity is calculated by addition of 2 vectors and previous velocity. The two vectors are:

    First vector: A vector lb from current position xi(t) to personal best pbi(t) is given in Eq. 1:

    $$lb = pbi(t) - xi(t).$$
    (1)

    Second vector: A vector gb which connects current position to the global best g(t) is given in Eq. 2:

    $$gb = g(t) - xi(t).$$
    (2)

    The Eq. 3 which calculates updated velocity is given below:

    $$vi(t + 1) = w \cdot vi(t) + c1 \cdot lb + c2 \cdot gb,$$
    (3)

    w is the real valued coefficient represents the inertia weight, c1 and c2 are acceleration parameters, c1 represents cognitive component and c2 represents social component. The new velocity is calculated as previous velocity added with personal best vector and global best vector.

  3. (c)

    Equation for updating the position of particle, can be described as given in Eq. 4:

    $$xi(t + 1) = xi(t) + vi(t + 1).$$
    (4)

A considerable impact on optimization performance has come from PSO parameters. A suitable selection of PSO parameters yields satisfactory performance. A PSO algorithm and its parameters must be chosen properly to balance exploration and exploitation to avoid premature convergence to a local optimum.

4 Proposed work

Many researchers have done few changes with respect to inertia weight in basic PSO algorithm to improve performance in the algorithm. In our proposed work, diversity based self-adaption has been applied to PSO to obtain better clusters. Using adaptive environment, diversity has been achieved with modified parameters like inertia weight, social and cognition constant as described in Eqs. 58.

  1. (a)

    To balance between exploration and exploitation, inertia weight plays an important role. Changes like, if inertia weight value is larger than it results into global exploration of search space whereas if inertia weight value is smaller than it results into local exploration of search space. As shown in Eq. (5), decreased value of inertia weight results into more appropriate solutions:

    $$w = M_{xw} - \;n \times \left( {M_{xw} - M_{nw} } \right)/\left( {\left\lfloor {0.75 \times M_{xn} } \right\rfloor } \right),$$
    (5)

    where Mxw and Mnw are maximum and minimum weight value and n is maximum number of iterations.

  2. (b)

    Equation (6) shows inertia weight parameter which is updated to achieve self-adaptiveness in PSO:

    $$w_{{f = 1/\left( {1 + 1.5*e^{{ - 2.5*f_{d} }} } \right)}}$$
    (6)

    where ‘fd is the current diversity status of population which can calculated by using mean Euclidean distance of each solution with others and given by (7):

    $$f_{d} = \left( {d_{g} - d_{mn} } \right)/\left( {d_{mx} - d_{mn} } \right)$$
    (7)

    where mean dg is distance value for best solution.

  3. (c)

    Cognitive and social constant also must be changed as population move from one state to other and it is given by Eq. (8):

    $$C_{i} \left( {n + 1} \right) = C_{i} \left( n \right) \pm \;\delta \;,\;i = 1,2\;\;{\text{where}}\;\;\delta \in \left[ {0.05 1} \right].$$
    (8)

Depending upon the value of \(f_{d}\) four different states of population has been considered as shown below:

  1. (a)

    Embryo stage [0.8 < fd < 1],

  2. (b)

    Exploration state [0.5 < fd≤ 0.8],

  3. (c)

    Exploitation state [0.2 < fd ≤ 0.5],

  4. (d)

    Convergence state [0 < fd≤ 0.2].

5 Experimental results

The experimental results have shown on two forms of PSO one is Adaptive weight PSO(AWPSO) which is basic PSO and other is Diversity based self-Adaptive weight PSO (DAWPSO). Two different domains have been applied to understand the benefits of diversity based self-adaptiveness in PSO. The first is the benchmark numerical optimization where the test bench has been taken as ACKLEY FUNCTION as shown in Eq. (9). It is a multimodal function and there is need to find the minima of this function. Because of multimodal characteristics, the population size for both the algorithm have been taken as 50 and 1000 iterations are performed to achieve the solution. As, the second domain, we have generated synthetic data and also used IRIS dataset from UCI repository to compare the performances of AWPSO and DAWPSO:

$$F_{{}} \left( x \right) = \exp \left[ { - 0.2\sqrt {\frac{1}{N}} \sum\limits_{i = 1}^{N} {x_{i}^{2} } } \right] - \exp \left( {\frac{1}{N}\sum\limits_{i = 1}^{N} {\cos \left( {2\pi x_{i} } \right)} } \right) + 20 + e.$$
(9)

5.1 Using Ackley function

The comparative performance analysis has been shown in Table 1 for 10 different independent trials. The obtained performance of DAWPSO gives overall 36% better minimization. DAWPSO has given the better exploration to find the minimum value as compared with AWPSO. The convergence characteristics between AWPSO and DAWPSO has been given in Fig. 1 for ACKLEY function. It is observed that at the earlier stage there is a fluctuation in the performance of DAWPSO but latter stages it has established the better exploration and after iteration no 200, better exploitation has been obtained.

Table 1 Function value for 10 independent trials in ACKLEY’s function
Fig. 1
figure 1

Convergence characteristic for Ackley’s function

In DAWPSO inertia weight is the function of the available diversity in the population. Under the possibilities of various transition phases, relative diversity has been shown in Fig. 2 and it is observed that diversity is well maintained in entire span of life. Hence, rather than having constant inertia weight throughout diversity-based variation has been proposed.

Fig. 2
figure 2

Diversity and inertia weight with iteration in optimizing Ackley’s function

5.2 Result using synthetic data set

A synthetic data set has been developed which has very well-defined clusters to verify the algorithm. Both the algorithms have worked nearly the same and have delivered 100% right results in 10 different trials. Their convergence graphs are shown in Figs. 3 and 4. In Fig. 3, the convergence characteristics indicates the quality of diversity exist in the process of evolution. For AWPSO, a sharp and immature convergence takes place at the beginning stage itself. In Fig. 4, it can be observed that using DAWPSO fluctuation in the convergence appears with high level of diversity.

Fig. 3
figure 3

Convergence characteristics by AWPSO on synthetic data

Fig. 4
figure 4

Convergence characteristics by DAWPSO synthetic data

Figure 5 shows the obtained centroid for training data and Test data using DAWPSO.

Fig. 5
figure 5

Synthetic data and obtained Centroids

5.3 Using IRIS data

To know the capability of algorithms in cluster application, Iris data set which has well known complexity in data set has been selected. Two different population size equal to 10 and 50 have been taken independently for each algorithm and 10 independent trails have been taken to understand the statistical variation.

Table 2 shows that out of 10 trails, AWPSO has converged only after 2 trails while DAWPSO has converged after 5 trials. Not only that, better quality of centroids has been achieved, hence higher value of F measure and P measure has been obtained.

Table 2 Performance over Iris data with Population size 10

When the population size has been increased to 50, slight benefit has been observed with AWPSO as shown in Table 3, while for all the 10 trials DAWPSO has converged with better quality of clusters.

Table 3 Performance over Iris data with population size 50

Table 4 shows the objective function in terms of intracluster distance using DAWPSO for IRIS data set with population size 50. The obtained centroid also has been listed, it can be observed that proper consistency has appeared in defining objective function.

Table 4 Obtained centroids and Intra cluster distance by DAWPSO over Iris data with population size 50

Convergence characteristics by DAWPSO on IRIS dataset has been shown in Fig. 6. The available relative diversity in the population along with the corresponding inertia weights has been also shown in Fig. 7. There is no regular pattern available to define the inertia weights.

Fig. 6
figure 6

Convergence characteristics by DAWPSO for Iris data set

Fig. 7
figure 7

Diversity and Inertia weight with iteration in optimizing Ackley’s function

6 Clustering for crime data

The proposed concept of clustering method DAWPSO has been applied over crime data of Karnataka state of India. The crime data for Karnataka and Bangalore during the year 2009 to 2014 with different criminal activities has been considered. Karnataka State crime data has been collected from National crime Record Bureau (NCRB) (https://data.gov.in/dataset-group-name/crime-statistics) which is shown in Table 5. The different types of crimes have been considered as the dimensions in data set for clustering purpose.

Table 5 Karnataka State crime data

The clustering mechanism has been applied to understand the similarity in the criminal activities with the year wise, this may help to understand whether the applied rules and regulations in those years were effective.

To mitigate the effect of nature of crimes, normalization has been applied as shown in Table 6, so that cluster performance will not be affected with high value of certain crime data when compared to low value of certain crime data.

Table 6 Karnataka State crime data in normalized form

The obtained centroids for 2 clusters have been shown in Table 7 along with data sets under each cluster.

Table 7 Obtained centroids and clusters by DAWPSO over Karnataka crime data

Crime data for Bangalore city in Karnataka, is shown in Table 8 and its normalized data is shown in Table 9, which has been considered for understanding the relative performance with time. The obtained centroid and clusters for Bangalore crime data using DAWPSO has shown in Table 10.

Table 8 Bangalore city crime data
Table 9 Bangalore city crime data in normalized form
Table 10 Obtained centroids and clusters by DAWPSO over Bangalore crime data

Performance of convergence characteristics for Karnataka State crime data has been shown in Fig. 8.

Fig. 8
figure 8

Convergence characteristics by DAWPSO for Karnataka data set

Figure 9 shows the obtained clusters for Karnataka and Bangalore crime dataset, it can be observed that criminal activities in Bangalore in year 2014 does not match with other years criminal activities. Similarly, in Karnataka 2009, 2010, 2013 and 2014 criminal activities were different compared to year 2011 and 2012. Such type of clusters is very helpful in the development and modification in the existing rules and regulation as well as in future also.

Fig. 9
figure 9

Clusters obtained for Karnataka and Bangalore

7 Conclusion

In this paper, diversity based self-adaptive PSO has been presented, which yields better exploration and enhances the performance of PSO. Different levels of diversity have been defined according to depth of diversity present in the population. Various possibilities of diversity based on distinct stages have been defined, which helps to switch the strategy value from one part to another. Diversity based interaction has been explored for numerical optimization, and it is observed that DAWPSO gives 36% better minimization when compared with AWPSO. The proposed method can be applied to any form of natural computing method wherever there is need to make controlling parameters self-adaptive. With proposed solution, high quality compact clusters have been obtained. The proposed method is also applied to understand the pattern and similarity in crime data between Karnataka and its Capital city Bangalore. It is observed that Bangalore crime patterns have less differences over the years when compared to Karnataka state.