This paper describes an automated visual inspection system for complex industrial purposes. The system is composed of four main interacting divisions. These represent knowledge, processing modules, data structures and the master program. The knowledge division is composed of a model and a set of rules. The model describes geometrical, positional and relational properties of the items under test. Rules are further classified into representational, procedural and control rules. Representational rules are a set of design rules that should be followed by items under inspection. Procedural rules are the specific steps that should be executed to ensure the validity of representational rules. Control rules are respon-sible for the sequence of different levels of system activities. Processing modules are simple image processing, morphological and pattern recognition procedures, each assigned a particular job. They share data at different levels of representation. The master program, supervized by the procedural and control rules, chooses the appropriate processing module to continuously update the data or create a new pictorial structure in order to achieve specific goals. The seperation between the rules and the master program makes it a learning system in the sense that it can be taught new models, design rules and inspection algorithms. Thus, it can be easily adapted to different applications.