Industry 4.0 is widely accepted to guide a novel and promising production paradigm where many advanced intelligent machines and latest technologies are utilized. The self-optimization and self-training behaviors of advanced intelligent machines make them more and more proficient when processing jobs; while the abrasion of their components reduces their work efficiency in the manufacturing process. Therefore, we address a flow shop scheduling problem with deteriorating and learning effects, where the processing time of jobs is a function of their starting time and positions in a schedule. In order to solve it efficiently, an artificial-molecule-based chemical reaction optimization algorithm is proposed. A set of artificial molecules are constructed based on some elitist solutions and adaptively injected into the population, which can enhance and balance exploration and exploitation abilities. The simulation experiments are carried out on a set of stochastic test problems with different sizes. The experimental results show that the proposed algorithm performs better than its peer algorithms in solving the investigated problem.