A method of controlling a washing machine, the method comprising: a first detection step of acquiring a first amount of laundry accommodated in a washing tub; selecting a first washing course among a plurality of washing courses including a first washing step to perform the washing based on the first laundry amount, and a second washing step to perform the washing based on a laundry state acquired using the artificial neural network as well as a second laundry amount, when the first laundry amount acquired in the first detection step is equal to or more than a preset first threshold value; performing a second detection step (S50, S60, S70, S80), when the first laundry amount acquired in the first detection step is less than the first threshold value or after the first washing step (S30, S35), wherein the second detection step (S50, S60, S70, S80) is for acquiring the second laundry amount accommodated in the washing tub by an output of an output layer of an artificial neural network while using a current value applied to a motor for rotating the washing tub during an accelerated rotation of the washing tub as an input data of an input layer of the artificial neural network previously learned by machine learning; selecting the second washing course among the plurality of washing courses, when the second laundry amount acquired in the second detection step (S50, S60, S70, S80) is less than the first threshold value; and a second washing step (S100, S110) of performing washing based on the second washing amount; wherein the state of the laundry is defined based on at least one of material of the laundry, hardness of the laundry, water content of the laundry, volumetric difference between dry laundry and wet laundry, and composition of the laundry. a first detection step of acquiring a first amount of laundry accommodated in a washing tub; selecting a first washing course among a plurality of washing courses including a first washing step to perform the washing based on the first laundry amount, and a second washing step to perform the washing based on a laundry state acquired using the artificial neural network as well as a second laundry amount, when the first laundry amount acquired in the first detection step is equal to or more than a preset first threshold value; performing a second detection step (S50, S60, S70, S80), when the first laundry amount acquired in the first detection step is less than the first threshold value or after the first washing step (S30, S35), wherein the second detection step (S50, S60, S70, S80) is for acquiring the second laundry amount accommodated in the washing tub by an output of an output layer of an artificial neural network while using a current value applied to a motor for rotating the washing tub during an accelerated rotation of the washing tub as an input data of an input layer of the artificial neural network previously learned by machine learning; selecting the second washing course among the plurality of washing courses, when the second laundry amount acquired in the second detection step (S50, S60, S70, S80) is less than the first threshold value; and a second washing step (S100, S110) of performing washing based on the second washing amount; wherein the state of the laundry is defined based on at least one of material of the laundry, hardness of the laundry, water content of the laundry, volumetric difference between dry laundry and wet laundry, and composition of the laundry.