科学

和ALICE聊天 — 一个极其强悍的人工智能虚拟人物

在人工智能的符号处理领域, 有一条最著名的金标准"图灵测试". 今天和ALICE聊了聊天, 发现她真的可以以假乱真, 不瞎扯的话, 真是不能分别真假. 大家有兴趣可以自己去聊聊看哦. 地址 http://alice.pandorabots.com

IEEE计算机学会南京分会学术报告会转帖

IEEE计算机学会南京分会近期将举行2次学术报告会,信息如下。欢迎参加。

IEEE CS Nanjing Chapter

**************************************************************************************

3月5日(星期五) 15:00-16:15,  南京大学蒙民伟楼404会议室

题目: Reconstruction from Randomized Graph via Low Rank Approximation

报告人: Xintao Wu

              Associate Professor, University of North Carolina at Charlotte

摘要:The privacy concerns associated with data analysis over social networks have spurred recent research on privacy-preserving social network analysis, particularly on privacy-preserving publishing of social network data. In this talk, we focus on whether we can reconstruct a graph  from the edge randomized graph such that accurate feature values can be recovered. In particular, we present a low rank approximation based reconstruction algorithm. We exploit spectral properties of the graph data and show why noise could be separated from the perturbed graph using low rank approximation. We also show key differences from previous findings of point-wise reconstruction methods on numerical data through empirical evaluations and theoretical justifications.

报告人简介:Dr. Xintao Wu is an Associate Professor of Software and Information Systems Department at University of North Carolina at Charlotte. He got his Ph.D. in Information Technology from George Mason University in August 2001, an ME degree in Computer Engineering from the Chinese Academy of Space Technology in 1997, and an BS degree in Information Science from the University of Science and Technology of China in 1994.  His major research interests include data mining, data privacy and security, and social network analysis. Dr. Wu is an editor of Springer’s Journal of Intelligent Information Systems and Spanish Higher Research Council’s Transaction on Data Privacy, and serves on program committees of many international conferences, including KDD, ICDM, SDM, PKDD, and PAKDD. He is serving as the program co-chair of the 2nd International Symposium on Data, Privacy and E-Commerce (ISDPE’10). Dr. Wu is a recipient of NSF CAREER Award.

**************************************************************************************

3月8日(星期一) 10:30-11:45,  南京大学蒙民伟楼404会议室

题目: Spectrum based Fraud Detection in Social Networks

报告人: Xintao Wu

              Associate Professor, University of North Carolina at Charlotte

摘要:Social networks have reached an important role in people’s lifes. Unfortunately, social networks are vulnerable to various attacks such as spam emails, viral marketing and the such. In this work we develop a spectrum based detection framework to discover the perpetrators of these attacks. In particular, we focus on Random Link Attacks (RLAs) in which the malicious user creates multiple false identities and interactions among those identities to later proceed to attack the regular members of the network. We show that RLA attackers can be filtered by using their spectral coordinate characteristics, which are hard to hide even after the efforts by the attackers of resembling as much as possible the rest of the network. We present an effective algorithm to detect RLAs using the set of suspects filtered by their spectral characteristics.  Experimental results show that our technique is very effective in detecting those attackers and outperforms techniques previously published.

报告人简介:Dr. Xintao Wu is an Associate Professor of Software and Information Systems Department at University of North Carolina at Charlotte. He got his Ph.D. in Information Technology from George Mason University in August 2001, an ME degree in Computer Engineering from the Chinese Academy of Space Technology in 1997, and an BS degree in Information Science from the University of Science and Technology of China in 1994.  His major research interests include data mining, data privacy and security, and social network analysis. Dr. Wu is an editor of Springer’s Journal of Intelligent Information Systems and Spanish Higher Research Council’s Transaction on Data Privacy, and serves on program committees of many international conferences, including KDD, ICDM, SDM, PKDD, and PAKDD. He is serving as the program co-chair of the 2nd International Symposium on Data, Privacy and E-Commerce (ISDPE’10). Dr. Wu is a recipient of NSF CAREER Award.

[转载]简单蚁群算法的实现

本文转载自http://blog.chinaunix.net/u1/34560/showart_312651.html

引言

蚁群算法(ant colony optimization,ACO),又称蚂蚁算法,是一种用来在图中寻找优化路径的机率型技术。它由Marco Dorigo于1992年在他的博士论文中引入,其灵感来源于蚂蚁在寻找食物过程中发现路径的行为。蚁群算法是一种模拟进化算法。初步的研究表明该算法具有许多优良的性质。针对PID控制器参数优化设计问题,将蚁群算法设计的结果与遗传算法设计的结果进行了比较,数值仿真结果表明,蚁群算法具有一种新的模拟进化优化方法的有效性和应用价值。蚁群算法是一种求解组合最优化问题的新型通用启发式方法,该方法具有正反馈、分布式计算和富于建设性的贪婪启发式搜索的特点。正因为蚁群算法有这些优点,很多研究者都在致力研究和改过它,本文的目的正是为了介绍蚁群算法,学习如何编写蚁群算法。

蚁群算法的介绍

昆虫世界中,蚂蚁的组成是一种群居的世袭大家庭,我们称之为蚁群。蚂蚁分为世袭制的蚁王(后)和工蚁两种,它们具有高度组织的社会性,彼此沟通不仅可以借助触觉和视觉的联系,在大规模的协调行动中还可以借助外激素(有些书称信息素)之类的信息介质。

首先我们要理解蚂蚁是如何觅食的,蚂蚁平时在巢穴附近作无规则行走,一量发现食物并不立即进食而是将之搬回蚁穴与其它蚂蚁分享,在食物小时则独自搬回蚁穴,否则就回蚁穴搬兵,一路上会留下外激素,食物越大外激素的浓度就越大,越能吸引其它的蚂蚁过去一起搬去食物,这样最终就能将食物全部搬回蚁穴。这个过程用程序实现看似非常复杂,要编写一个“智能”的蚂蚁也看似不太可能,事实上每个蚂蚁只做了非常简单的工作:检查某个范围内有无食物,并逐渐向外激素浓的方向运动。简而言之,蚁群运动无非是同时反复执行多个简单规则而已。下面详细说明蚁群中的这些简单规则:

1、范围:蚂蚁观察到的范围是一个方格世界,蚂蚁有一个参数为速度半径(一般是3),那么它能观察到的范围就是3*3个方格世界,并且能移动的距离也在这个范围之内。

2、环境:蚂蚁所在的环境是一个虚拟的世界,其中有障碍物,有别的蚂蚁,还有外激素,外激素有两种,一种是找到食物的蚂蚁洒下的食物外激素,一种是找到窝的蚂蚁洒下的窝的外激素。每个蚂蚁都仅仅能感知它范围内的环境信息。环境以一定的速率让外激素消失。

3、觅食规则:在每只蚂蚁能感知的范围内寻找是否有食物,如果有就直接过去。否则看是否有外激素,并且比较在能感知的范围内哪一点的外激素最多,这样,它就朝外激素多的地方走,并且每只蚂蚁多会以小概率犯错误,从而并不是往外激素最多的点移动。蚂蚁找窝的规则和上面一样,只不过它对窝的外激素做出反应,而对食物外激素没反应。

4、移动规则: 每只蚂蚁都朝向外激素最多的方向移,并且,当周围没有外激素指引的时候,蚂蚁会按照自己原来运动的方向惯性的运动下去,并且,在运动的方向有一个随机的小的扰动。为了防止蚂蚁原地转圈,它会记住最近刚走过了哪些点,如果发现要走的下一点已经在最近走过了,它就会尽量避开。

5、避障规则:如果蚂蚁要移动的方向有障碍物挡住,它会随机的选择另一个方向,并且有外激素指引的话,它会按照觅食的规则行为。

7、播撒外激素规则:每只蚂蚁在刚找到食物或者窝的时候撒发的外激素最多,并随着它走远的距离,播撒的外激素越来越少。

根据这几条规则,蚂蚁之间并没有直接的关系,但是每只蚂蚁都和环境发生交互,而通过外激素这个纽带,实际上把各个蚂蚁之间关联起来了。比如,当一只蚂蚁找到了食物,它并没有直接告诉其它蚂蚁这儿有食物,而是向环境播撒外激素,当其它的蚂蚁经过它附近的时候,就会感觉到外激素的存在,进而根据外激素的指引找到了食物。成功的觅食算法正是最小化搜索食物的时间。

蚁群算法的实现

理解蚁群算法的实质之后写出一个简单蚁群算法也不是太困难,关键是实现以上介绍的几个规则,下面用JAVA简单讲述一下以上规则的实现。

1、蚂蚁:蚂蚁是蚁群中最小的单位,是所以简单规则应用的最小个体。

 

1
2
3
4
5
6
7
8
9
10
11
12
public class Ant
{
    public Square SQUARE;           //蚂蚁所在方格
    public Food CARRYING = null;    //所搬的食物数
    public int ID;                  //蚂蚁的编号
    public boolean HELPING = false; //是否帮忙搬运食物
 
public void move(int turn)
{
    //蚂蚁移动到下一个方格
}
}

2、范围:蚂蚁所在的方格应该包含附近的方格编号,所含食物数量,蚂蚁数量,外激素的浓度,以及坐标等信息。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
public class Square
{ public Square NE;            //附近的8个方向的方格
 
     public Square N;
     public Square NW;
     public Square W;
     public Square SW;
     public Square S;
     public Square SE;
     public Square E;
     public LinkedList ANTS;        //本方格中包含的蚂蚁
     public Food FOOD;            //本方格中包含的食物数
     public Nest NEST;                //方格为蚁穴
     public Pheromone_1 PHEROMONE_1;            //本方格中的外激素含量
     public int X;            //本方格的坐标
     public int Y;
     private World WORLD;            //所属的环境
     public boolean WALL;            //是否有障碍物
 
    public Square(int x, int y, World world)
    {
        FOOD = null;
        NEST = null;
        PHEROMONE_1 = null;
        X = x;
        Y = y;
        WORLD = world;
        WALL = false;
        ANTS = new LinkedList();
    }

3、环境:环境是由多个方格组成的,是一个平面的,因此用一个方格的二维数组来表示是最合适不过的。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
public class World
{
    private Square[][] WORLD;        //定义环境二维数组
    private int WIDTH;                //环境的长宽
    private int HEIGHT;
    private Pheromone_1List P1LIST;        //保存所有外激素的列表
 
    public World(Pheromone_1List p1list)
    {
        this.WIDTH = Settings.WIDTH;
        this.HEIGHT = Settings.HEIGHT;
        this.P1LIST = p1list;
        WORLD = new Square[WIDTH][HEIGHT];
    }

     4、觅食规则,移动规则和避障规则:这三种规则全都跟蚂蚁的移动方向有关,并在移动前都要先计算周围方格的外激素浓度,选择外激素浓度最高的方格方向移动。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
private Square chooseBestSquare()
{
     Square[] square_list = {SQUARE.E, SQUARE.NE, SQUARE.N, SQUARE.NW, SQUARE.W, SQUARE.SW, SQUARE.S, SQUARE.SE};
        double current_best_value = 0;
        double value = 0;
        Square square = SQUARE;
        // 选择最好的方格
 
        for(int i=0;i<square_list.length;i++)
        {
            value = calculateSquareValue(square_list[i]);//计算方格值
            if(value > current_best_value)
            {
                current_best_value = value;
                square = square_list[i];
            }
        }
        if(square.ANTS.size() >= Settings.MAXIMUM_NUMBER_OF_ANTS)
        {
          return SQUARE;
        }
        return square;
    }

1
2
3
4
5
6
7
8
9
10
11
12
private double calculateSquareValue(Square s)
{
    double[] thresholds = Settings.THRESHOLDS;
    if(s==null || s.WALL) // 方格有障碍物
    {
        return -100000;
    }
 
    // 计算方格中各项参数的值
    return s.getFood()*thresholds[0]        // 食物
    + s.getPheromone_1() * thresholds[1]    // 外激素
}

5、播撒外激素规则:每只蚂蚁找到食物后会根据食物的数量播撒相应量的外激素,以便其它蚂蚁能够更快得找到这堆食物。

1
2
3
4
5
private void putPheromone_1(double amount)
{
    if(SQUARE.getPheromone_1() < Settings.PHEROMONE_LIMIT)
     SQUARE.addPheromone_1(amount);
}

从以上蚁群算法中各个要素的代码来看,实现蚁群算法并不难。每只蚂蚁并不是像我们想象的需要知道整个环境的信息,它们只关心很小范围内的眼前信息,而且根据这些局部信息利用几条简单的规则进行决策,这样,在蚁群这个集体里,复杂性的行为就会凸现出来。这就是人工生命、复杂性科学解释的规律。

蚁群算法的不足

本文实现的蚁群算法只是简单的大致模拟蚁群的觅食过程,真正的蚂蚁觅食过程远比这个复杂,比如增加蚂蚁搬运食物的距离和数量,蚂蚁在搬运食物发现更大的食物可能会丢弃原有食物,还可以增加蚂蚁搬运食物回蚁穴的最短路径的求解。同时需要注意的是,由于蚁群算法觅食的过程,蚁群算法可能会过早的收敛并陷入局部最优解。