High-level cognitive reasoning for making decisions entails fusing information in the form of symbolic observations, domain knowledge of various real-world entities and their attributes, and interactions between them. Complex events are difficult to define, primarily due to a variety of ways in which different parts of the event can be observed. Real world event inference therefore requires efficient representation of the complex interplay between the constituent entities and events, while taking into account uncertainty and ambiguity of the observations. Decision making is a complex task that involves analyzing data (of different level of abstraction) from disparate sources and with different levels of certainty, merging the information by weighing in on some data source more than other, and arriving at a conclusion by exploring all possible alternatives. Lack of effective visual processing tools, incomplete domain knowledge, lack of uniformity and constancy in the data, and faulty sensors are some of sources of uncertainty in the data. For example, target appearance frequently changes over time and across different sensors, data representations may not be compatible due to difference in the characteristics, levels of granularity and semantics encoded in data.
In this work, we adopt Markov Logic Networks (MLN) 
, a generic framework for overcoming the huge semantic gap between the low-level visual processing of raw data obtained from disparate sensors and the desired high-level symbolic information for making decisions on complex events occurring in a scene. MLN provides mathematically sound techniques for representing and fusing the data at multiple levels of abstraction, and across multiple modalities to perform complex task of decision making. MLN uses probabilistic first order predicate logic (FOPL) for representing the decomposition of real world events into visual concepts, interactions among the real world entities and contextual relations between visual entities and the scene elements. It should be noted that while the first order logic formulas may be typically true in the real world, they are not always true. In most domains it is very difficult to come up with non-trivial formulas that are always true, and such formulas capture only a fraction of the relevant knowledge. Despite its expressiveness, pure first-order logic has limited applicability to practical problems of reasoning. Therefore, in MLN framework, complex events and object assertions are defined by hard and soft rules. Each formula has an associated weight that reflects how strong a constraint is. The higher the weight, the greater the difference in probability between a world that satisfies the formula and one that does not, provided that other variables stay equal. In general, a rule for detecting a complex action entails all of its parts, and each part provides (soft) evidence for the complex action. Therefore, even if some parts of a complex action are not seen, it is still possible to detect the complex event using the MLN inference.
Related Work: There have been numerous frameworks for visual event representation and recognition. The frameworks can be broadly divided into declarative approaches [22, 19] and probabilistic approaches 
. In declarative approaches events are represented with declarative templates. Events are typically organized in a hierarchy, starting with primitive events at the bottom and composite events on top. The recognition of a composite event proceeds in a bottom-up manner. These approaches have several drawbacks: (a) A miss or false detection of a primitive event, which occurs frequently in computer vision, not just in crowded or poorly illuminated conditions, often leads to irrecoverable failures in composite event recognition; (b) Uncertainty is often not modeled because of which these methods are generally not robust to typical errors in image analysis. Approaches that are based on probabilistic grammars for event recognition such as typically use simple rules. They do not allow existential quantifiers, which are needed for dealing with missing observations. It is also difficult to express domain constraints such as a car can only be driven by one person
using generative grammars. Furthermore, methods to perform probabilistic propagation are better understood for graphical models than for probabilistic grammars. Traditionally Hidden Markov Models(HMM), Propagation Nets (P-Net)
and other forms of Dynamic Bayesian Networks(DBN) had been widely applied to event recognition. Being restrictive in terms of number of actors and types of activities that can be modeled due to fixed structure of the model, they require large annotated examples for training. Among rule based activity modeling techniques is the probabilistic method based on multi-agent belief network for complex action detection by Intille and Bobick. The method dynamically generates belief network for recognizing complex action using the pre-specified structure that represents temporal relationships between the actions of interacting agents. More recent research has focused on stochastic grammars based event recognition such as [2, 10, 23]. Gupta et al. developed a storyline model using probabilistic grammars to dynamically infer relations between component actions and also learns visual appearance models for each actions using the weakly labeled video data. Ryoo and Aggarwal  modeled composite actions and interactions between agents using non-probabilistic Context Free Grammar(CFG). Sridhar et. al developed an unsupervised method to identify component events of a complex activity by modeling interactions between subsets of tracks of entities as a relational graph that captured qualitative spatio-temporal relationships between these agents. MLN generalizes over these probabilistic models and offers several advantages over other rule-based activity recognition methods. MLN allows ability to write more flexible rules with existential quantifiers over sets of entities, and therefore allows greater expressive power of the domain knowledge compared to other probabilistic rule based methods such as attribute grammars or dynamic Bayesian networks 
. Also methods to perform probabilistic inference are better understood for graphical models used in MLN than for probabilistic grammars. In the past MLN has been applied in the context of scene understanding and activity inference[28, 24, 14, 17]. Tran and Davis developed a visual event modeling framework based MLN that addressed a wide range of uncertainties due to detection, missing observations, inaccurate logic rules and identity maintenance. Later works [24, 14, 17] further developed the MLN based systems to infer multi-agent activities, use domain knowledge to improve scene interpretation and incorporated Allen’s interval logic to improve scalabilty of MLN inference.
Contributions: Our work most closely resembles earlier works [28, 14] and significantly contributes towards overall understanding and application of MLN in the following way: (a) Unlike past approaches that used hard evidences, our framework models uncertainty at multiple levels of inference, and propagates it bottom-up for more accurate high-level decision making ; (b) We scale MLN inference to more complex activities involving network of visual sensors and increased uncertainty due to inaccurate target associations across sensors ; (c) Apply rule weights learning for fusing information acquired from multiple sensors (target track association) and ; (d) Enhance visual concept extraction techniques using distance metric learning.
2 System Overview
fig:MLNProcessing(Left) shows various stages involved in MLN inference. We apply MLN to detect complex activities in a multi-sensor data acquisition and processing scenario as shown in fig:MLNProcessing(Right). Following components constitute an MLN based decision system.
These modules process videos and extract visual concepts in the form of constants, that denote space-time locations of the entities detected in the scene, scene elements, entity class and primitive events directly inferred from the visual tracks of the entities. The constants are used to ground(instantiate) the variables in the FOPL formulae of MLN. Our visual processing algorithms are composed of detection, tracking and classification of human and vehicle targets, and attributes extraction such as carrying a bag or not. Targets are localized in the scene using background subtraction and tracked in 2D image sequence using Kalman filtering. Targets are classified to human/vehicle based on their aspect ratio. Vehicles are further classified into Sedans, SUVs and mini vans using 3D vehicle fitting The Atomic events about target dynamics (moving or stationary) are generated from the target tracks. For each event we generate constants for the time interval and pixel location of the target in 2D image (or the location on the map if homography is available). We learn discriminative deformable part-based
classifiers to compute a probability scores for whether a human target is carrying a bag. The classification score is fused across the track by taking average of top K confident scores(based on absolute values) and is calibrated to a probability score using logistic regression.
Knowledge Base (KB): KB is composed of a set of hard and soft rules modeling spatio-temporal interactions between various entities and the temporal structure of various complex events. The hard rules are assertions that should be strictly followed. Violation of hard rules sets the probability of the complex event to zero. On the other hand, soft rules allow uncertainty and exceptions. Violation of soft rules will make the complex event less probable but not impossible.
Markov Network (MN): Constants generated from visual processing step are used to instantiate (referred to as grounding) the variables in the KB rules. The grounded predicates for a Markov Random Field, referred to as Markov Network(MN). KB can be thought as template for constructing the Markov network. For every set of constants (detected visual entities and atomic events) observed in a scene, the FOPL rules involving the corresponding variables are instantiated to form the Markov network. Each node in MN represents either a grounded predicate or an inferred predicate. An edge exists between two nodes if the predicates appear in a formula. From the grounded network, MAP inference can be run to infer probabilities of query nodes after conditioning them with observed nodes and marginalizing out the hidden nodes.
As very few data sets offer complex events across a network of sensors, for training and evaluation we collected our own data from a network of four sensors with non-overlapping fields-of-view (see 1(Right)
). The data contained a variety of activities involving multiple human and vehicle agents. Targets detected from multiple sensors are associated across multiple sensors using appearance, shape and spatial-temporal cues. The Homography is estimated by manually labeling correspondence between the image and the ground map(done only once). The coordinated activities include : dropping bag in a building and stealing bag from a building.fig:MLNProcessing shows the entire processing pipeline. Specifically, we apply MLN to perform three key tasks: (a) Semantic scene labeling (see Section4); (b) Target association across visual sensors (see Section5) ; (c) Probabilistic fusion for detecting Complex events(see Section6). Next section discusses the theoretical underpinnings of MLN.
3 Markov Logic Networks
MLN allows multiple KB to be combined into a compact probabilistic model by assigning weights to the formulas, and is supported by a large range of learning and inference algorithms. Not only the weights but also the rules can be learned from the data set using Inductive logic programming(ILP). As the exact inference is intractable, Gibbs sampling (MCMC process) is used for performing the approximate inference. The rules in MLN form a template for constructing the Markov Network (MN) from the evidence. Evidence are in the form of grounded predicates, obtained by instantiating variables using all possible observed constants. The truth assignment for each of the predicates of the MRF defines a possible world
. The probability distribution over the possible worlds
, defined as joint distribution over the nodes of the corresponding MRF network, is the product of potentials associated with the cliques of the Markov Network:
where denotes the truth assignments of the nodes corresponding to clique of the MRF and is the potential function associated to the clique. Note that a clique in MRF corresponds to a grounded formula of the MLN. is the feature associated to the clique and is 1 if the associated grounded formula is true and 0 otherwise, for each possible state of the nodes in the clique. The weights associated to the formula , can be assigned manually or learned. This can be reformulated as:
where is the number of the times formula is true for different possible states of the nodes corresponding the clique . Z in the above equations refers to the partition function and is not used in the inference process, that involves maximizing the log-likelihood function. The equations simply represent that if the rule with weight is satisfied for a given set of constants and grounded atoms, the corresponding world is times more probable than when the rule is not satisfied. For detecting occurrence of an activity, we query the MLN using the corresponding predicate. Given a set of evidence predicates , hidden predicates and query predicates , inference involves evaluating the MAP (Maximum-A-Posterior) distribution over query predicates conditioned on the evidence predicates and marginalizing out the hidden nodes as :
Weights Learning in MLN: MLN supports both generative and discriminative weights learning. Generative learning involves maximizing the log of the likelihood function to estimate the weights of the rules. Unlike the inference process, that ignores the partition function Z, the gradient computation uses partition function Z. Even for reasonably sized domains, optimizing log-likelihood is intractable as it involves counting number of groundings in which
formula is true. Therefore, instead of optimizing likelihood, generative learning in existing implementation uses pseudo-log likelihood (PLL). Difference between PLL and log-likelihood is that instead of using chain rule to factorize the joint distribution over entire nodes, we use Markov blanket to factorize the joint distribution into conditionals. The advantage of doing this is that predicates that do not appear in the same formula as a node can be ignored. This can speed up inference greatly. We use similar approach to scale inference to support multiple activities and longer videos. Discriminative learning on the other hand maximizes the conditional log-likelihood(CLL) of the queried atom given the observed atoms. The set of queried atoms need to be specified for discriminative learning. All the atoms are partitioned into observedand queried .
Discriminative learning maximizes the following conditional log-likelihood (CLL):
are the number of true groundings of the ith formula (composed of both queried and observed predicates). CLL is easier to optimize compared to the combined log-likelihood function of generative learning as the evidence constrains the probability of the query atoms to a much fewer possible states. Note that CLL and PLL optimization are equivalent when evidence predicates include the entire Markov Blanket of the query atoms. A number of gradient based optimization techniques exist(voted perceptron, contrastive divergence, diagonal Newton method and scaled conjugate gradient) for minimizing negative CLL. Singla and Domingos showed that learning weights by optimizing the CLL gives more accurate estimates of weights compared to PLL optimization. In this work we only used discriminative learning for estimating weights.
4 Scene Interpretation
Contextual relations between the scene elements and the entities provide useful information about an activity occurring in a scene. We use domain knowledge, such as humans can disappear only if they go out of scene or at an entrance of a building and human and vehicle footprints are more likely to be on a ground plane, to formulate weighted rules in MLN and perform functional scene labeling of the image regions or refine scene element classification. Our scene analysis module first segments an image into multiple zones based on appearance cues using . We use Hoiem et al.  to categorize the image segments(see fig:BuildingEntryExit top and middle rows) into one of the three categories . Semantic scene labels can then be used to improve target association across sensors by enforcing spatial constraints on the targets such a human can only appear in image entry region. To that end, we automatically infer probability map of the entry or exit regions of the scene by formulating following rules:
here to assign lower probability to the adjacent regions. Predicates , and are generated from the visual processing module, and represent if an agent appears or disappears in a zone, and whether two zones are adjacent to each other. The adjacency relation between a pair of zones, , is computed based on whether the two segments lie near to each other (distance between the centroids) and if they share boundary. In addition to the spatio-temporal characteristics of the targets, scene elements classication scores are used to write more complex rules for extacting more meaningful information about the scene such as building entry/exit regions. Scene element classification scores can be easily ingested into the MLN inference system as soft evidences (weighted predicates) zoneClass(z, ). An image zone is a building(or garage) entry or exit region if it is a vertical structure and only human targets appear or disappear in those image regions. Additional probability may be associated to adjacent regions also :
fig:BuildingEntryExit(Bottom row) shows the results of one of the camera image regions classified as building entry/exit, as obtained from MLN inference.
5 Target Re-aquisition across Multiple Sensors
Targets detected in multiple sensors are fused in MLN using different entity similarity scores and spatial-temporal constraints, with the fusion parameters (weights) learned discriminatively using the MLN framework from a few labeled exemplars.
5.1 Entity Similarity Relation Modeling
Similarity relation modeling forms a critical component of information fusion systems in order to associate entities and events observed from data acquired from diverse and disparate sources.Challenges to robust target similarity measure across different sensors include substantial variations resulting from the changes in sensor settings (white balance), illumination and viewing conditions, drastic changes in the pose and shape of the targets, and noise due to partial occlusions, cluttered backgrounds and presence of similar entities in the vicinity of the target. Invariance to some of these changes (such as illumination conditions) can be achieved using distance metric learning, that learns a transformation in the feature space such that image features corresponding to the same object are closer to each other.
Entity Similarity Modeling using Metric Learning: We employ metric learning approaches based on Relevance Component Analysis(RCA)
, to enhance similarity relation between same entities when viewed under different imaging conditions. RCA seeks to identify and down-scale global unwanted variability within the data belonging to same class of objects. The method transforms the feature space using a linear transformation by assigning large weights to the only relevant dimensions of the features and de-emphasizing those parts of the descriptor which are most influenced by the variability in the sensor data. For a set of N data pointsbelonging to K semantic classes with data points , RCA first centers each data point belonging to a class to a common reference frame by subtracting in-class means (thus removing inter-class variability). It then reduces the intra-class variability by computing a whitening transformation of the in-class covariance matrix as:
The whitening transform of the matrix, , is used as the linear transformation of the feature subspace such that features corresponding to same object are closer to each other.
5.2 Target Association using MLN
We apply MLN inference to associate the trajectories of the tracked targets across multiple cameras. Zhang et al. solved the global data association problem by formulating it as a min-cut/max-flow network. However, the method cannot handle long-term occlusions and provides only a single solution. Instead, we develop a solution based on MLN to perform data association and handle the problem of long-term occlusion across multiple sensors, while maintaining the multiple hypotheses for associations. The soft evidence of association is outputted as the predicate with similarity score recalibrated to probability value, and used in high-level inference of activities. In the past, Leung and Herbin have employed MLN for data association of tracklets within a single sensor, to improve tracking performance. They adopt a simplistic approach of connecting two tracklets when their spatio-temporal coherence is less than a threshold value. However in our framework, we first learn the weights of MLN rules that govern the fusion of spatial, temporal and appearance similarity scores to determine equality of two entities observed in two different sensors. We use a subset of videos with labeled target associations to discriminatively train our MLN models.
Tracklets extracted from Kalman filtering are used to perform target associations. Set of tracklets across multiple sensors are represented as , where a tracklet is defined as . Here is the sensor ID, is the start time, is the end time, is the location in the image or the map, is the class of the entity (human or vehicle), is the mensurated Euclidean 3D size of the entity (only used for vehicles), and is appearance model of the target entity. The MLN rules for fusing multiple cues for the global data association problem are:
Note here that rules corresponding to individual cues have weights that are usually lower than which is a much stronger rule and therefore carries larger weight. The rules yield a fusion framework that is somewhat similar to the posterior distribution defined in . However, here we are also learning the weights corresponding to each of the rules using only a few labeled examples. Next, we discuss the computation of the similarity predicates for each of the five similarity cues used for target association across sensors.
This models temporal difference between the end and start time of a target across a pair of cameras using Gaussian distribution:
For the non-overlapping sensors,
computes this temporal difference. If two cameras are nearby and there is no traffic signal between them, the variance tends to be smaller and contribute a lot to the similarity measurement. However, when two cameras are further away from each other or there are traffic signals in between, this similarity score will contribute less to the overall similarity measure since the distribution would be widely spread due to large variance.
Spatial Constraints: The spatial distance between objects in the two cameras is measured at the enter/exit regions of the scene. For a road with multiple lanes, each lane can be an enter/exit area. We apply MLN inference to directly classify image segments into enter/exit areas as discussed in section 4. The spatial probability is defined as:
Enter/exit areas of a scene are located mostly near the boundary of the image or at the entrance of a building. Function is the homography transform to project image locations and to map. Two targets detected in two cameras are only associated if they lie in the corresponding enter/exit areas.
Size Similarity: The size similarity score is computed for vehicle targets where we fit a 3D vehicle shape model  to the silhouette of the target. The probability is computed as :
3D vehicle fitting requires estimation of full projective transform which is performed manually by fitting a 3D vehicle model(sedan) with known dimensions to an image target.
Classification Similarity: For computing classification similarity
, we first characterize the empirical probability of classifying a target for each of the visual sensor, as classification accuracy depends on the camera intrinsics and calibration accuracy. Empirical probability is computed from the class confusion matrix for each sensor A where each matrix elementrepresents probability of classifying object to class . For computing the classification similarity we assign higher weight to the camera with higher classification accuracy. The joint classification probability of the same object observed from camera and is defined as:
where and are the observed classes and is the groundtruth. Classification in each sensor is conditionally independent given the object class, the similarity measure can be computed as:
where and can be computed from the confusion matrix, and can be either set to uniform or estimated as the marginal probability from the confusion matrix.
Appearance Similarity for Vehicles and Humans: Since vehicles exhibit significant variation in shapes due to viewpoint changes, shape based descriptors did not improve matching scores. Covariance descriptor based on only color, gave sufficiently accurate matching results for vehicles across sensors. Humans exhibit significant variation in appearance compared to vehicles and often have noisier localization due to moving too close to each other, carrying an accessory and forming significantly large shadows on the ground. For matching humans however, unique compositional parts provide strongly discriminative cues for matching, and has already been applied in some of the recent works. Our algorithm extends this work and computes similarity scores between target images by matching densely sampled patches within a constrained search neighborhood (longer horizontally and shorter vertically). The matching score is boosted by the saliency score that characterizes how discriminative a patch is based on its similarity to other reference patches. A patch exhibiting larger variance for the K nearest neighbor reference patches is given higher saliency score . In addition to the saliency, in our similarity score we also factor in a relevance based weighting scheme to down weigh patches, that are predominantly due to background clutter. We use RCA to obtain such a relevance score from a set of training examples. The similarity measure between the two images, and , is computed as :
where denote patch from the image ,
is the normalization constant, and the denominator term penalizes large difference in saliency scores of two patches. RCA uses only positive similarity constraints to learn a global metric space such that intra-class variability is minimized. Patches corresponding to highest variability are due to the background clutter and are automatically down weighed during matching. The relevance score for a patch is computed as absolute sum of vector coefficients corresponding to that patch for the first column vector of the transformation matrix. fig:RCAMask shows the relevance mask learned using RCA for the Viper data set used for benchmarking proposed algorithm with the. Appearance similarity between targets are used to generate soft evidence predicates for associating target in camera A to target in camera B.
|Event Predicate||Description about the Event|
|zoneBuildingEntExit(Z)||Zone is a building entry exit|
|zoneAdjacentZone(,)||Two zones adjacent to each other|
|humanEntBuilding(..)||Human enters building|
|parkVehicle(A)||Vehicle arriving in the parking lot &|
|stopping in the next time interval|
|driveVehicleAway(A)||Stationary vehicle that starts|
|moving in the next time interval|
|passVehicle(A)||Vehicle observed passing across|
|embark(A,B)||Human A comes near vehicle B and|
|disappears after which vehicle B|
|disembark(A,B)||Human target appears close to a|
|stationary vehicle target|
|embarkWithBag(A,B)||Human A with carryBag(…)|
|predicate embarks a vehicle B|
|equalAgents(A,B)||Agents A and B across different|
|sensors are same(Target association)|
|sensorXEvents(…)||Events observed in sensor X|
6 Formulation of MLN Rules
MLN allows principled data fusion from multiple sensors, while taking into account the errors and uncertainties, and achieving potentially more accurate inference over doing the same using individual sensors. The information extracted from different sensors differs in the representation and the encoded semantics, and therefore should be fused at multiple levels of granularity. Low level information fusion would combine primitive events, local entity interactions in a sensor to infer sub-events. Higher level inference for detecting complex events will progressively use more meaningful information as generated from low-level inference to make decisions. Uncertainties may introduces at any stage due to missed or false detection of targets and atomic events, target tracking and association across cameras and target attribute extraction. To this end, unlike past MLN based activity recognition frameworks[28, 14, 17]) that used hard evidences, we generate predicates with an associated probability(soft evidence). The soft evidence thus enables propagation of uncertainty from the lowest level of visual processing to high-level decision making.
6.1 Events Modeling and Recognition
The visual processing module generates groundings at fixed time intervals by detecting and tracking the targets in the videos. The generated constants include - sensor ids, agent ids, zones ids and types (for semantic scene labeling tasks), agent class types, location and time. Spatial location is a constant pair either as an image pixel coordinates or on the ground map obtained using image to map homography. The time is represented as an instant or as an interval using starting and ending time . We detect two classes of agents in the scene - vehicles and humans. Image zones are categorized into one of the three geometric classes classes. The grounded atoms are intantiated predicates and represent either an agent attribute or any primitive event it is performing. The ground predicates include: (a) zone classifications ; (b) zone where an agent appears or disappears ; (c) agent classification ; (d) primitive events , , , , , and , ; and (e) agent is carrying a bag . The grounded predicates and constants generated from the visual processing module are used to generate Markov Network.
Complex events are recognized by querying for the corresponding unobserved predicates, running the inference using fast Gibbs sampler and estimating their probabilities. These predicates involve both unknown hidden predicates that are marginalized out during inference and the queried predicates. We list the relevant predicates along with their description in the table 1. We applied MLN inference to detect two different complex activities that are composed of sub-events listed in table 1:
bagStealEvent(…): Vehicle appears in sensor , a human disembarks the vehicle and enters a building. Vehicle drives away and parks in sensor C2 field of view. After sometime vehicle drives away and is seen passing across sensor . It appears in sensor where the human reappears with a bag and embarks the vehicle. The vehicle drives away from sensor.
bagDropEvent(…): The sequence of events are similar to bagStealEvent(…) with the difference that human enters the building with a bag in sensor and reappears in sensor without a bag.
Complex activities are spread across network of four sensors and involve interactions between multiple agents, a bag and the environment. For each of the activities, we first identify a set of sub-events that are detected in each sensor (denoted by sensorXEvents(…)). The MLN rules for detecting sub-events for the complex event bagStealEvent(…) in sensor are
The predicate sensorType(…) is to enforce hard constraints that only constants generated from sensor are used for inference of the query predicate. Each of the sub-events are detected using MLN inference engine associated to each sensor(see fig:HierarchicalMLN) and the result predicates are fed into higher level MLN along with the associated probabilites, for inferring complex event. The rule formulation of the bagStealEvent(…) activity are as follows:
First order predicate logic (FOPL) rule for detecting generic complex event involving multiple agents and target association across multiple sensors. For each sensor, we define a predicate for events occurring in that sensor. The agents in that sensor are associated to the other sensor using target association MLN engine (that infers equalAgent(…) predicate). The predicate afterInt(,) is true if the time interval occurs before the .
6.2 Complexity of Inference using MLN
Inference in MLN is P- hard problem, with no polynomial time algorithm for exactly counting the number of true cliques(representing instantiated formulas) in the grounded network(an MRF). The nodes in MN grows exponentially with the number of instances and formulas in the Knowledge Base(KB). Since all the constants are used to instantiate all the variables of the same type, in all the predicates used in the rules, predicates with high arity cause combinatorial explosion in the number of possible cliques formed after the grounding step. Similarly long rules also cause high order dependencies in the relations and larger cliques in MN. No exact algorithm is available for minimization of the energy function involving high-order cliques.
MLN Implementation: Alchemy[5, 28, 17, 14] is an open-source system that provides a number of algorithms for statistical relational learning and inference based on the Markov logic representation. However Alchemy implementation suffers from many drawbacks: (a) top-down grounding leading to rapid increase in memory requirements even for small set of rules ; (b) no support for soft evidences in the inference and ; (c) non-scalable due to the requirement of having entire grounded network to be in the memory during inference. A more recent implementation of MLN, TUFFY overcomes all these limitations by providing bottom-up grounding by employing Relation Database Management System (RDBMS) as a backend tool for storage and query. The rules in the MLN are written to minimize combinatorial explosion during inference. TUFFY allows use of conditions, as the last component of either the antecedent or the consequent, to restrict the range of constants used for grounding a formula. Using hard constraints further also improves tractability of inference as an interpretation of the world violating a hard constraint has zero probability and can be readily eliminated during bottom-up grounding. Using multiple smaller rules instead of one long rule also improves the grounding by forming smaller cliques in the network and fewer nodes. We further reduce the arity of the predicates by combining multiple dimensions of the spatial location (X-Y coordinates) and time interval (start and end time) into one unit. This greatly improves the grounding and inference step. For example, the arity of the predicate , , , , , , gets reduced to ,, .
Scalable Hierarchical Inference in MLN: Inference in MLN for sensor activities can be significantly improved if instead of generating a single Markov Network(MN) for all the activities, we explicitly partition the MN into multiple activity specific networks containing only the predicate nodes that appear in only the formulas of the activity. This restriction effectively considers only the Markov Blanket(MB) of a predicate node for computing expected number of true groundings and had been widely used as an alternative to exact computation. From implementation perspective this is equivalent to having a separate MLN inference engine for each activities, and employing a hierarchical inference (see fig:HierarchicalMLN) where the semantic information extracted at each level of abstraction is propagated from the lowest visual processing level to sub-event detection MLN engine, and finally to the high-level complex event processing module. Moreover, since the primitive events and various sub-events (as listed in Table 1
) are dependent only on temporally local interactions between the agents, for analyzing long videos we divide a long temporal sequence into multiple overlapping smaller sequences, and run MLN engine within each of these sequences independently. Finally, the query result predicates from each temporal windows are merged using a high level MLN engine for inferring long-term events extending across multiple such windows. A significant advantage of TUFFY is that it supports soft evidences that allows propagating uncertainties in the spatial and temporal fusion process used in our framework. Result predicates from low-level MLN are incorporated as rules with the weights computed as log odds of the predicate probability. This allows partitioning the grounding and inference in MN in order to scale it to larger problems.
MLN inference engine was used for detecting complex events in a 1 hour long videos, acquired from 4 camera sensors (see fig:MultiCameraData). The inference engine was run on windows of 15 mins each to maintain tractability of MLN inference. Each of the captured sequence were high-definition videos of resolution and provided sufficient number of pixels to detect carrying bag attributes.
Semantic Scene Labeling: For scene labeling we only show qualitative results. We ran image segmentation to generate a total of 217 segments(zones) in the image. Each segment is classified into various geometric classes as in using appearance and geometric cues  as discussed in section 4. As another example of our MLN based framework, we wrote MLN rules to incorporate the footprints of the targets in the image regions as additional cues to label them as HORIZONTAL. fig:GroundPlaneRefinement shows the effect of applying this domain knowledge to refine labels of some difficult to classify regions.
Entity Attribute Extraction: Our system currently only detects whether a human target is carrying bag or not. We trained Deformable Part-based Model (DPM) based classifiers for detecting humans carrying bag. Our training dataset contained 624 positive exemplars and 265 negative exemplars. For testing we used 502 positive exemplars and 571 negative exemplars. We further subcategorized bags into large(being pushed or dragged), medium(carry bags) and small (held along). We evaluated the performance of the attribute detector on Virat dataset and iLIDS. fig:BagDetection(left) shows the true positive rates (TPR) and false positive rates (FPR) for the three classes of objects. On the right we show samples from the training dataset and classification response on our complex activity sequence.
Vehicle Track Association: As our current dataset did not have significant number of vehicular targets, we evaluated our vehicle association algorithm on a separate MultiCamera dataset of 24-minute durations, pixel resolution, taken from four different locations with non overlapping fields of view, and contained 154 vehicle targets. fig:MultiCamera shows the snapshots of the same target observed from the 4 sensors. This dataset is challenging due to: i) cameras being more that 750 meters apart and have traffic signals in between ; ii) less reliable classification due to inaccurate projection matrix for each camera ; iii)large variation in color and illumination changes; iv) not all vehicles passed through all the 4 cameras. Table 2 shows the effect of applying distance metric learning in improving the precision-recall rates of targets correctly associated across cameras. Our similarity measure is composed of appearance as well as class, size and spatial-temporal constraints (see section 5.2). For computing appearance of vehicles we evaluated covariance descriptor of color histogram and gradient filter responses, with and without distance metric learning(RCA). We used 60 bases vectors learned using RCA for transforming the color histogram space and 600 dimensions for the covariance descriptor computed from image gradients. The results of tracking accuracy are shown in table 2
. We also show the accuracy using F-measure (or F-score), defined as. The results show that use of RCA improves the overall precision/recall, and gradient information only marginally improved the precision while maintaining the same level of recall rates. The overall improvement in the F-measure after applying RCA was from 79.57% to 84.26%. Also note that including an appearance model without RCA did not improve F-score significantly.
|Appearance||No Appear-||Color||RCA Only||RCA Color|
Human Track Association: We compared the accuracy of human target association with the state-of-the-art Saliency Detection(SDC) based algorithm  on the standard dataset ViPER. The data contains 637 targets viewed from two different cameras from different viewpoints and at different time instants. We use Cumulative Matching Characteristic(CMC) metric (matching rate w.r.t. rank) to demonstrate the improvement in the accuracy. fig:RCASDC shows the plots obtained after using their similarity score and the plots after incorporating distance metric learning using RCA in the score. Note here that the results shown here did not use individual human masks used for generating results in . We show results for the cases when we compute relevance score using different number of columns (1,5 and 10), and also when we compute RCA transformation for different regularization parameters “lambda”. Notice that RCA significantly boosts accuracy of the original algorithm.
Complex Event Detection: We evaluate our MLN based system for recognizing complex events on multi-sensor video sequence acquired from four sensors. Table 3 summarizes the complex event detection results of our system. We applied MLN inference to detect 2 complex activities of
and involving multiple interacting targets and spread across 4 sensors. In order to avoid high computational cost of MLN inference due to large number of predicates, we adopt hierarchical processing (discussed in section 6.1) to perform inference in MLN. We used TUFFY for our MLN implementation. Although past works such as  adopt similar approach for inference, our system employs soft evidences in the form of weighted predicates, that allowed principled propagation of uncertainty from the low-level of MLN inference for scene label refinement and visual processing, to the high-level MLN inference for inferring complex events. Inference of the long rule for typically takes 1 hour on 2.8 GHz quad core machine. Due to high arity of the predicate for , it generates possible ground atoms all possible combinations of constants in grounded atoms. Recognizing these complex events require detection of multiple sub-events as listed in the table 3. Overall events detection precision was and the recall was . The videos only contained 4 complex events 3 of which was successfully detected. The fourth activity of was falsely detected as due to inaccurate carrying bag attribute detector. Finally, in most of the events, recall was high while there were large number of false detections. This was primarily due to number of false human targets interacting with vehicle or building entrances. Inference in MLN is always performed on interval instances it has already seen in the visual predicates. MLN inference on a domain of time intervals will be intractable and therefore we report accuracy in terms of # of detections only (and not on time intervals of the events). The weights of our soft rules were manually set while the weights of the MLN rules for target track association across different sensors were learned.
In this work we demonstrate a Markov Logic based decision system for recognizing complex events in videos acquired from a network of sensors. We apply Markov Logic Networks as a framework for representing and applying domain knowledge, a probabilistic fusion engine to combine information of varied modalities, and a tool for making decisions under uncertainty. We further enhance algorithms for modeling similarity relation between observations of an entity from different sensors. We also applied MLN to the problem of semantic and functional labeling of image regions in a scene. Finally, we demonstrated that decision systems based on Markov Logic Networks can be scaled to detect complex multi-agent activities in long video sequences using hierarchical inference without sacrificing prediction accuracy.
Acknowledgements: This research was sponsored by Office of Naval Research under contract number N00014-11-M-0037.
A. Bar-Hillel, T. Hertz, N. Shental, and D. Weinshall.
Learning a mahalanobis metric from equivalence constraints.
Journal of Machine Learning Research, 6:937–965, 2005.
-  A. F. Bobick and Y. A. Ivanov. Action recognition using probabilistic parsing. In CVPR, pages 196–202, 1998.
-  M. Brand, N. Oliver, and A. Pentland. Coupled hidden markov models for complex action recognition. In CVPR, 1997.
-  T. E. Choe, Z. Rasheed, G. Taylor, and N. Haering. Globally optimal target tracking in real time using max-flow network. In ICCV Workshops, pages 1855–1862, 2011.
P. Domingos and D. Lowd.
Markov Logic: An Interface Layer for Artificial Intelligence. Synthesis Lectures on Artificial Intelligence and Machine Learning. 2009.
-  P. Domingos and M. Richardson. Markov logic: A unifying framework for statistical relational learning. In Intro. to Statistical Relational Learning, MIT Press, 2007.
-  P. F. Felzenszwalb and D. P. Huttenlocher. Efficient graph-based image segmentation. International Journal of Computer Vision, 59(2):167–181, 2004.
-  P. F. Felzenszwalb, D. A. McAllester, and D. Ramanan. A discriminatively trained, multiscale, deformable part model. In CVPR, 2008.
-  D. Gray, S. Brennan, and H. Tao. Evaluating appearance models for recognition, reacquisition, and tracking. In IEEE Workshop on Performance Evaluation of Tracking and Surveillance (PETS), 2007.
-  A. Gupta, P. Srinivasan, J. Shi, and L. S. Davis. Understanding videos, constructing plots learning a visually grounded storyline model from annotated videos. In CVPR, pages 2012–2019, 2009.
-  D. Hoiem, A. A. Efros, and M. Hebert. Recovering surface layout from an image. International Journal of Computer Vision, 75(1):151–172, 2007.
-  iLIDS. Imagery library for intelligent detection systems. 2011.
-  S. S. Intille and A. F. Bobick. Visual recognition of multi-agent action using binary temporal relations. In CVPR, pages 1056–, 1999.
-  A. Kembhavi, T. Yeh, and L. S. Davis. Why did the person cross the road (there)? scene understanding using probabilistic logic models and common sense reasoning. ECCV, pages 693–706, 2010.
-  V. Leung and S. Herbin. Flexible tracklet association for complex scenarios using a markov logic network. In ICCV Workshops, pages 1870–1875, 2011.
-  Y. L. Li Zhang and R. Nevatia. Global Data Association for Multi-Object Tracking Using Network Flows. 2008.
-  V. I. Morariu and L. S. Davis. Multi-agent event recognition in structured scenarios. CVPR, pages 3289–3296, 2011.
-  J. Muncaster and Y. Ma. Activity recognition using dynamic bayesian networks with automatic state selection. WACV, 59(2):39–47, 2007.
-  R. Nevatia, T. Zhao, and S. Hongeng. Hierarchical language-based representation of events in video stream. IEEE Proc. of CVPRW on Event Mining, 59(2):39–47, 2003.
-  F. Niu, C. Ré, A. Doan, and J. Shavlik. Tuffy: Scaling up statistical inference in markov logic networks using an rdbms. In VLDB, pages 994–999, 2011.
-  S. Oh and et. al. A large-scale benchmark dataset for event recognition in surveillance video. In CVPR, 2011.
-  N. Rota and M. Thonnat. Activity recognition from video sequences using declarative models. In ECAI, 2000.
-  M. S. Ryoo and J. K. Aggarwal. Recognition of composite human activities through context-free grammar based representation. In CVPR (2), pages 1709–1718, 2006.
-  A. Sadilek and H. A. Kautz. Recognizing multi-agent activities from gps data. In AAAI, 2010.
-  Y. Shi, A. F. Bobick, and I. A. Essa. Learning temporal sequence model from partially labeled data. In CVPR (2), pages 1631–1638, 2006.
-  P. Singla and P. Domingos. Discriminative training of markov logic networks. In AAAI, pages 868–873, 2005.
-  M. Sridhar, A. G. Cohn, and D. C. Hogg. Unsupervised learning of event classes from video. AAAI, pages 180–186, 2010.
-  S. D. Tran and L. S. Davis. Event modeling and recognition using markov logic networks. ECCV, pages 610–623, 2008.
-  Z. Tu, X. Chen, A. L. Yuille, and S. C. Zhu. Image parsing: Unifying segmentation, detection, and recognition. In Toward Category-Level Object Recognition, pages 545–576, 2006.
-  O. Tuzel, F. Porikli, and P. Meer. Region covariance: A fast descriptor for detection and classification. In ECCV, pages 589–600, 2006.
-  J. Yamato, J. Ohya, and K. Ishii. Recognizing human action time-sequential images using hidden markov model. In CVPR, pages 673–680, 1992.
-  R. Zhao, W. Ouyang, and X. Wang. Unsupervised salience learning for person re-identification. In CVPR, pages 3586–3593, 2013.