An oscillatory neural model of multiple object tracking (Kazanovich and Borisyuk 2006)

 Download zip file 
Help downloading and running models
Accession:79145
An oscillatory neural network model of multiple object tracking is described. The model works with a set of identical visual objects moving around the screen. At the initial stage, the model selects into the focus of attention a subset of objects initially marked as targets. Other objects are used as distractors. The model aims to preserve the initial separation between targets and distractors while objects are moving. This is achieved by a proper interplay of synchronizing and desynchronizing interactions in a multilayer network, where each layer is responsible for tracking a single target. The results of the model simulation are presented and compared with experimental data. In agreement with experimental evidence, simulations with a larger number of targets have shown higher error rates. Also, the functioning of the model in the case of temporarily overlapping objects is presented.
Reference:
1 . Kazanovich Y, Borisyuk R (2006) An oscillatory neural model of multiple object tracking. Neural Comput 18:1413-40 [PubMed]
Citations  Citation Browser
Model Information (Click on a link to find other models with that property)
Model Type: Connectionist Network;
Brain Region(s)/Organism:
Cell Type(s):
Channel(s):
Gap Junctions:
Receptor(s):
Gene(s):
Transmitter(s):
Simulation Environment: C or C++ program;
Model Concept(s): Oscillations; Spatio-temporal Activity Patterns; Simplified Models;
Implementer(s): Kazanovich, Yakov [yakov_k at impb.psn.ru]; Borisyuk, Roman [rborisyuk at plymouth.ac.uk];
// AttentionView.cpp : implementation of the CAttentionView class
// Project MOT
// Kazanovich June 2005

#include "stdafx.h"
#include "Attention.h"

#include "AttentionDoc.h"
#include "AttentionView.h" 

#ifdef _DEBUG
#define new DEBUG_NEW 
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAttentionView

IMPLEMENT_DYNCREATE(CAttentionView, CScrollView)

BEGIN_MESSAGE_MAP(CAttentionView, CScrollView)
	//{{AFX_MSG_MAP(CAttentionView)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CScrollView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CScrollView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CScrollView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAttentionView construction/destruction

CAttentionView::CAttentionView()
{
	// TODO: add construction code here

}

CAttentionView::~CAttentionView()
{
}

BOOL CAttentionView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CScrollView::PreCreateWindow(cs);
}

/////////////////////////////////////////////////////////////////////////////
// CAttentionView drawing

#define RED	RGB(150, 0, 0)
#define BLUE RGB(0, 0, 200)
#define GREEN RGB(0, 150, 0)
#define LIGHT_RED RGB(255, 50, 50)
#define LIGHT_GREEN RGB(50, 255, 50)
#define BLACK RGB(0, 0, 0)
#define CYAN RGB(30, 255, 255)

#include "mot.h"

void Connec();
void My_error(CString);
void Netalloc();
void Netinit();
void Netreinit();
void Pardef();
void Step();
void Trajclose();
void Trajopen();
void Trajsave();
void Stimgen();
void Stimvar(double t);

extern struct network net[noaf];
extern struct parameters par;
extern struct integration integr;
extern struct image im;

const float scalex = 1;
const float scaley = 7;

const int sqx = 2;	// Scale (not less than 2)
const int sqy = 2;
const int sqx0 = 10;// Origine of the view
const int sqy0 = 10;
const int pmax = 7;	// (pmax + 1) maximal number of frames in the row

int it;	// the number of iterations

void CAttentionView::OnDraw(CDC* pDC)
{
	int i;
	COLORREF color, palett[7] = {RED, BLUE, GREEN, LIGHT_RED, LIGHT_GREEN, CYAN, BLACK};
	
	Pardef();
	int n = par.n;
	double resthresh = integr.resthresh; 
	double maxt = integr.maxt;
	double dt = integr.dt;

	it = 0;
	double t = 0;
	int p = 0, q = 0;	// coordinates of frames (viewports)

    #ifdef RANDOMIZE_ON
	srand(time(NULL));
	#endif

	Stimgen();
	#ifdef TRAJSAVE_ON
		Trajopen();
	#endif
	Netalloc();
	Netinit();
	Connec();

	while (t <= maxt)
	{//1+
		// Displaying the current state
		if (it%10 == 0)
		{//2+
			// Viewport formation
			CPoint view_origine(sqx0, sqy0);;
			CPoint viewport_origine( (ncolumns + 1)*p*sqx,
								(nrows + 1)*q*sqy);
			viewport_origine += view_origine;
			pDC->SetViewportOrg(viewport_origine);
			int viewport_sizex = ncolumns*sqx;
			int viewport_sizey = nrows*sqy;
			CSize viewport_size(viewport_sizex, viewport_sizey);
			pDC->SetViewportExt(viewport_size);
		
			// Frame drawing
			pDC->SelectStockObject(BLACK_PEN);
			pDC->SelectStockObject(WHITE_BRUSH);
			pDC->Rectangle(0, 0, viewport_size.cx, viewport_size.cy);

			for (i = 1; i <= n; i++)
			{//3+
				if (net[0].osc[i].amp > 0)
				{//4+
					int i1 = i - 1;			// enumaration starts from 1
					int col = i1%ncolumns;	// column in the frame
					int row = i1/ncolumns;	// row in the frame
					int x = col*sqx;			// position in the frame
					int y = row*sqy;
					int x1 = x;
					int y1 = y;
					int x2 = x1 + sqx; 
					int y2 = y1 + sqy;
				
					color = palett[6]; 
					for (int oaf = 0; oaf < noaf; oaf++)
					{
						if (net[oaf].osc[i].amp > resthresh)
						{	color |= palett[oaf]; }
					}
					CPen penSolid(PS_SOLID, 1, color);
					CBrush brushFilled(color);
					pDC->SelectObject(penSolid);
					pDC->SelectObject(brushFilled);
					pDC->Rectangle(x1, y1, x2, y2);
				}//4-
			}//3-

			// Marking targets
			for (i = 0; i < nobj; i++)
			{
				if (im.obj[i].type == target)
				{
					int x1 = (im.obj[i].cx - im.r - 1)*sqx;
					int y1 = (im.obj[i].cy - im.r)*sqx;
					int x2 = (im.obj[i].cx + im.r + 1)*sqx;
					int y2 = (im.obj[i].cy + im.r + 2)*sqx;
					CPen penSolid(PS_SOLID, 2, palett[5]);
					pDC->SelectObject(penSolid);
					pDC->SelectStockObject(HOLLOW_BRUSH);
					pDC->Rectangle(x1, y1, x2, y2);
				}
			}

			// Indexing output frame locations
			p++;
			if (p > pmax)
			{
				p = 0;
				q++;
			}

		}//2-

		#ifdef TRAJSAVE_ON
			Trajsave();
		#endif
		Step();

		if ( (t > integr.expos) && (t < integr.maxt - integr.probe) && 
			(it%integr.movement_dt == 0) ) 
		{	
			Stimvar(t);
			Netreinit(); 
			Connec();
		}

		t += dt;
		it++;
	}//1-
	#ifdef TRAJSAVE_ON
		Trajclose();
	#endif
}

void CAttentionView::OnInitialUpdate()
{
	CScrollView::OnInitialUpdate();

	CSize sizeTotal;
	// TODO: calculate the total size of this view
	sizeTotal.cx = 3000;
	sizeTotal.cy = 3000;
	SetScrollSizes(MM_TEXT, sizeTotal);
}

/////////////////////////////////////////////////////////////////////////////
// CAttentionView printing

BOOL CAttentionView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}

void CAttentionView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add extra initialization before printing
}

void CAttentionView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
	// TODO: add cleanup after printing
}

/////////////////////////////////////////////////////////////////////////////
// CAttentionView diagnostics

#ifdef _DEBUG
void CAttentionView::AssertValid() const
{
	CScrollView::AssertValid();
}

void CAttentionView::Dump(CDumpContext& dc) const
{
	CScrollView::Dump(dc);
}

CAttentionDoc* CAttentionView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CAttentionDoc)));
	return (CAttentionDoc*)m_pDocument;
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CAttentionView message handlers