Human vision system exploits this fact by visual selective attention mechanisms towards important and informative regions. A computational model of combination both bottom-up and top-down simulating human vision system for machine vision inspection is proposed. In this model, top-down knowledge-based information is highlighted to integrate into bottom-up stimulus-based process of vision attention. The model is tested on inspecting contaminants in cotton images. Experiment result shows that the proposed model is feasible and effective in visual inspection. And it is available and quasi-equivalent to human vision attention.